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 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"`;
|
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({
|
expect(user).toEqual({
|
||||||
firstName: 'Namn',
|
firstName: 'Namn',
|
||||||
lastName: 'Namnsson',
|
lastName: 'Namnsson',
|
||||||
isAuthenticated: true
|
isAuthenticated: true,
|
||||||
|
personalNumber: "195001182046",
|
||||||
})
|
})
|
||||||
|
|
||||||
const children = await api.getChildren()
|
const children = await api.getChildren()
|
||||||
|
|
|
@ -56,6 +56,7 @@ it(' notifications correctly', () => {
|
||||||
sender: 'Elevdokumentation',
|
sender: 'Elevdokumentation',
|
||||||
url: 'https://elevdokumentation.stockholm.se/loa3/gradesStudent.do',
|
url: 'https://elevdokumentation.stockholm.se/loa3/gradesStudent.do',
|
||||||
dateCreated: '2020-12-18T14:59:46.340Z',
|
dateCreated: '2020-12-18T14:59:46.340Z',
|
||||||
|
dateModified: "2020-12-18T15:59:46.340Z",
|
||||||
category: null,
|
category: null,
|
||||||
type: 'webnotify',
|
type: 'webnotify',
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { parseDate } from '../utils/dateHandling'
|
||||||
import { Notification } from '../types'
|
import { Notification } from '../types'
|
||||||
|
|
||||||
export const notification = ({
|
export const notification = ({
|
||||||
notification: { messageid, dateCreated },
|
notification: { messageid, dateCreated, dateModified },
|
||||||
notificationMessage: {
|
notificationMessage: {
|
||||||
messages: {
|
messages: {
|
||||||
message: {
|
message: {
|
||||||
|
@ -21,6 +21,7 @@ export const notification = ({
|
||||||
sender: name,
|
sender: name,
|
||||||
url: linkbackurl,
|
url: linkbackurl,
|
||||||
dateCreated: parseDate(dateCreated) || '',
|
dateCreated: parseDate(dateCreated) || '',
|
||||||
|
dateModified: parseDate(dateModified) || '',
|
||||||
category,
|
category,
|
||||||
type,
|
type,
|
||||||
})
|
})
|
||||||
|
|
|
@ -32,7 +32,7 @@ export const newsDetails = (childId: string, newsId: string) =>
|
||||||
export const image = (url: string) => `${urlLoggedIn}/NewsBanner?url=${url}`
|
export const image = (url: string) => `${urlLoggedIn}/NewsBanner?url=${url}`
|
||||||
|
|
||||||
export const notifications = (childId: string) =>
|
export const notifications = (childId: string) =>
|
||||||
`${urlLoggedIn}/Overview/GetNotification?childId=${childId}`
|
`${urlLoggedIn}/notifications/getnotifications?childId=${childId}`
|
||||||
|
|
||||||
export const menuRss = (childId: string) =>
|
export const menuRss = (childId: string) =>
|
||||||
`${urlLoggedIn}/Matsedel/GetMatsedelRSS?childId=${childId}`
|
`${urlLoggedIn}/Matsedel/GetMatsedelRSS?childId=${childId}`
|
||||||
|
|
|
@ -138,6 +138,7 @@ export interface Notification {
|
||||||
id: string
|
id: string
|
||||||
sender: string
|
sender: string
|
||||||
dateCreated: string
|
dateCreated: string
|
||||||
|
dateModified: string
|
||||||
message: string
|
message: string
|
||||||
url: string
|
url: string
|
||||||
category: string | null
|
category: string | null
|
||||||
|
|
Loading…
Reference in New Issue