Create Notification normalizer
This commit is contained in:
parent
e5f1fae956
commit
37827c34d9
2 changed files with 20 additions and 0 deletions
BIN
app/soapbox/normalizers/__tests__/notification-test.js
Normal file
BIN
app/soapbox/normalizers/__tests__/notification-test.js
Normal file
Binary file not shown.
20
app/soapbox/normalizers/notification.ts
Normal file
20
app/soapbox/normalizers/notification.ts
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import {
|
||||||
|
Map as ImmutableMap,
|
||||||
|
Record as ImmutableRecord,
|
||||||
|
} from 'immutable';
|
||||||
|
|
||||||
|
// https://docs.joinmastodon.org/entities/notification/
|
||||||
|
const NotificationRecord = ImmutableRecord({
|
||||||
|
account: null,
|
||||||
|
chat_message: null, // pleroma:chat_mention
|
||||||
|
created_at: new Date(),
|
||||||
|
emoji: null, // pleroma:emoji_reaction
|
||||||
|
id: '',
|
||||||
|
status: null,
|
||||||
|
target: null, // move
|
||||||
|
type: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
export const normalizeNotification = (notification: ImmutableMap<string, any>) => {
|
||||||
|
return NotificationRecord(notification);
|
||||||
|
};
|
Loading…
Reference in a new issue