Ignore:
Timestamp:
08/24/26 20:57:09 (13 days ago)
Author:
kikisrbinoska <srbinoskakristina07@…>
Branches:
main
Parents:
a6e33d1
Message:

Added corrected entitef from the ER diagram and changes for the logic to be coresponding to the ddl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapterx-frontend/src/store/notificationStore.ts

    ra6e33d1 re882b92  
    1717  notifications: Notification[]
    1818  fetchUserNotifications: (userId: number) => Promise<void>
    19   addNotification: (n: { recipientUserId: number; type: string; content: string; link?: string }) => Promise<void>
     19  addNotification: (n: { userId: number; contentType: string; content: string; storyId?: number; link?: string }) => Promise<void>
    2020  markAllRead: () => Promise<void>
    2121  markRead: (id: number) => Promise<void>
     
    3333        notification_id: n.id,
    3434        user_id: userId,
    35         type: n.type ?? 'info',
    36         title: n.type ?? 'Notification',
     35        type: n.contentType ?? 'info',
     36        title: n.contentType ?? 'Notification',
    3737        message: n.content,
    3838        link: n.link,
     
    4646  },
    4747
    48   addNotification: async ({ recipientUserId, type, content, link }) => {
     48  addNotification: async ({ userId, contentType, content, storyId, link }) => {
    4949    try {
    5050      await axios.post(`${API}/notifications`, {
    5151        content,
    52         recipientUserId,
    53         type,
     52        contentType,
     53        userId,
     54        storyId,
    5455        link,
    5556      }, { headers: getAuthHeaders() })
Note: See TracChangeset for help on using the changeset viewer.