@@ -195,7 +195,7 @@ const userStory = {
195195 }
196196 return apiCall ( '/graphql' , productQuery )
197197 } ,
198- getNotifications : ( userId ) => {
198+ getNotificationsByUserId : ( userId ) => {
199199 const notificationQuery = {
200200 query : `query {
201201 userStoryNotifications (where: {
@@ -223,27 +223,27 @@ const userStory = {
223223 }
224224 return apiCall ( '/graphql' , policyQuery )
225225 } ,
226- updateNotifications : ( policyId , seenBy ) => {
227- const notificationQuery = {
228- query : `mutation updateNotifications($seenBy: [ID]){
229- updateUserStoryNotification(input: {
230- where: {
231- id: "${ policyId } "
232- }
233- data: {
234- seenBy: $seenBy
235- }
236- }) {
237- userStoryNotification {
238- id
239- }
240- }
241- }` ,
226+ markNotificationAsRead : ( notificationId , seenBy ) => {
227+ const markNotificationAsReadQuery = {
228+ query : `mutation updateNotifications($seenBy: [ID]) {
229+ updateUserStoryNotification(input: {
230+ where: {
231+ id: "${ notificationId } "
232+ }
233+ data: {
234+ seenBy: $seenBy
235+ }
236+ }) {
237+ userStoryNotification {
238+ id
239+ }
240+ }
241+ }` ,
242242 variables : {
243243 seenBy : seenBy
244244 }
245245 }
246- return apiCall ( '/graphql' , notificationQuery )
246+ return apiCall ( '/graphql' , markNotificationAsReadQuery )
247247 } ,
248248 getUserDetails : ( userId ) => {
249249 const userQuery = {
@@ -332,51 +332,6 @@ const userStory = {
332332 postCommentReply : ( data ) => {
333333 return apiCall ( '/user-story-comment-threads' , data )
334334 } ,
335- getNotificationsByUserId : ( userId ) => {
336- const getNotificationsByUserIdQuery = {
337- query : `query {
338- userStoryNotifications (where: {
339- users: {
340- id: "${ userId } "
341- }
342- }){
343- message
344- id
345- users {
346- id
347- }
348- seenBy {
349- id
350- }
351- date
352- link
353- }
354- }`
355- }
356- return apiCall ( '/graphql' , getNotificationsByUserIdQuery )
357- } ,
358- markNotificationAsRead : ( notificationId , seenBy ) => {
359- const markNotificationAsReadQuery = {
360- query : `mutation updateNotifications($seenBy: [ID]){
361- updateUserStoryNotification(input: {
362- where: {
363- id: "${ notificationId } "
364- }
365- data: {
366- seenBy: $seenBy
367- }
368- }) {
369- userStoryNotification {
370- id
371- }
372- }
373- }` ,
374- variables : {
375- seenBy : seenBy
376- }
377- }
378- return apiCall ( '/graphql' , markNotificationAsReadQuery )
379- } ,
380335 updateVotes : ( storyId , updatedFollowerIds ) => {
381336 const updateVotesQuery = {
382337 query : `
0 commit comments