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:
Kajetan Kazimierczak 2021-09-30 22:06:45 +02:00 committed by GitHub
parent f97714346e
commit 4a0841a704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 4 deletions

View File

@ -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"`;

View File

@ -171,7 +171,8 @@ describe('api', () => {
expect(user).toEqual({
firstName: 'Namn',
lastName: 'Namnsson',
isAuthenticated: true
isAuthenticated: true,
personalNumber: "195001182046",
})
const children = await api.getChildren()

View File

@ -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',
},

View File

@ -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,
})

View File

@ -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}`

View File

@ -138,6 +138,7 @@ export interface Notification {
id: string
sender: string
dateCreated: string
dateModified: string
message: string
url: string
category: string | null