fix: 🐛 Get all notifications. Add modified date to notifications (#150)
* fix: 🐛 Get all notifications. Add modified date * test: 💍 fix test for added personnummer in fake data
This commit is contained in:
parent
f97714346e
commit
4a0841a704
|
@ -22,7 +22,7 @@ exports[`handles route news 1`] = `"https://etjanst.stockholm.se/vardnadshavare/
|
|||
|
||||
exports[`handles route newsDetails 1`] = `"https://etjanst.stockholm.se/vardnadshavare/inloggad2/News/GetNewsArticle?newsItemId=321&childId=123"`;
|
||||
|
||||
exports[`handles route notifications 1`] = `"https://etjanst.stockholm.se/vardnadshavare/inloggad2/Overview/GetNotification?childId=123"`;
|
||||
exports[`handles route notifications 1`] = `"https://etjanst.stockholm.se/vardnadshavare/inloggad2/notifications/getnotifications?childId=123"`;
|
||||
|
||||
exports[`handles route schedule 1`] = `"https://etjanst.stockholm.se/vardnadshavare/inloggad2/Calender/GetSchema?childId=123&startDate=2021-01-01&endDate=2021-01-01"`;
|
||||
|
||||
|
|
|
@ -171,7 +171,8 @@ describe('api', () => {
|
|||
expect(user).toEqual({
|
||||
firstName: 'Namn',
|
||||
lastName: 'Namnsson',
|
||||
isAuthenticated: true
|
||||
isAuthenticated: true,
|
||||
personalNumber: "195001182046",
|
||||
})
|
||||
|
||||
const children = await api.getChildren()
|
||||
|
|
|
@ -56,6 +56,7 @@ it(' notifications correctly', () => {
|
|||
sender: 'Elevdokumentation',
|
||||
url: 'https://elevdokumentation.stockholm.se/loa3/gradesStudent.do',
|
||||
dateCreated: '2020-12-18T14:59:46.340Z',
|
||||
dateModified: "2020-12-18T15:59:46.340Z",
|
||||
category: null,
|
||||
type: 'webnotify',
|
||||
},
|
||||
|
|
|
@ -3,7 +3,7 @@ import { parseDate } from '../utils/dateHandling'
|
|||
import { Notification } from '../types'
|
||||
|
||||
export const notification = ({
|
||||
notification: { messageid, dateCreated },
|
||||
notification: { messageid, dateCreated, dateModified },
|
||||
notificationMessage: {
|
||||
messages: {
|
||||
message: {
|
||||
|
@ -21,6 +21,7 @@ export const notification = ({
|
|||
sender: name,
|
||||
url: linkbackurl,
|
||||
dateCreated: parseDate(dateCreated) || '',
|
||||
dateModified: parseDate(dateModified) || '',
|
||||
category,
|
||||
type,
|
||||
})
|
||||
|
|
|
@ -32,7 +32,7 @@ export const newsDetails = (childId: string, newsId: string) =>
|
|||
export const image = (url: string) => `${urlLoggedIn}/NewsBanner?url=${url}`
|
||||
|
||||
export const notifications = (childId: string) =>
|
||||
`${urlLoggedIn}/Overview/GetNotification?childId=${childId}`
|
||||
`${urlLoggedIn}/notifications/getnotifications?childId=${childId}`
|
||||
|
||||
export const menuRss = (childId: string) =>
|
||||
`${urlLoggedIn}/Matsedel/GetMatsedelRSS?childId=${childId}`
|
||||
|
|
|
@ -138,6 +138,7 @@ export interface Notification {
|
|||
id: string
|
||||
sender: string
|
||||
dateCreated: string
|
||||
dateModified: string
|
||||
message: string
|
||||
url: string
|
||||
category: string | null
|
||||
|
|
Loading…
Reference in New Issue