diff --git a/lib/__tests__/__snapshots__/routes.test.ts.snap b/lib/__tests__/__snapshots__/routes.test.ts.snap index 2eec925e..2789311c 100644 --- a/lib/__tests__/__snapshots__/routes.test.ts.snap +++ b/lib/__tests__/__snapshots__/routes.test.ts.snap @@ -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"`; diff --git a/lib/api.test.ts b/lib/api.test.ts index d38c131e..40c90028 100644 --- a/lib/api.test.ts +++ b/lib/api.test.ts @@ -171,7 +171,8 @@ describe('api', () => { expect(user).toEqual({ firstName: 'Namn', lastName: 'Namnsson', - isAuthenticated: true + isAuthenticated: true, + personalNumber: "195001182046", }) const children = await api.getChildren() diff --git a/lib/parse/__tests__/notifications.test.ts b/lib/parse/__tests__/notifications.test.ts index fa155a59..b65f2ee0 100644 --- a/lib/parse/__tests__/notifications.test.ts +++ b/lib/parse/__tests__/notifications.test.ts @@ -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', }, diff --git a/lib/parse/notifications.ts b/lib/parse/notifications.ts index 6ae42a77..81bc3328 100644 --- a/lib/parse/notifications.ts +++ b/lib/parse/notifications.ts @@ -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, }) diff --git a/lib/routes.ts b/lib/routes.ts index 250f255a..1c97f3c4 100644 --- a/lib/routes.ts +++ b/lib/routes.ts @@ -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}` diff --git a/lib/types.ts b/lib/types.ts index 4e6511be..5f779adf 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -138,6 +138,7 @@ export interface Notification { id: string sender: string dateCreated: string + dateModified: string message: string url: string category: string | null