File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -101,12 +101,12 @@ describe('query userAlerts', () => {
101101 const res = await client . query ( QUERY ) ;
102102
103103 delete expected . userId ;
104+ delete expected . flags ;
104105
105106 expect ( res . data . userAlerts ) . toEqual ( {
106107 ...expected ,
107108 lastBanner : expected . lastBanner . toISOString ( ) ,
108109 lastChangelog : expected . lastChangelog . toISOString ( ) ,
109- lastFeedSettingsFeedback : expected . lastFeedSettingsFeedback . toISOString ( ) ,
110110 } ) ;
111111 } ) ;
112112
@@ -275,6 +275,7 @@ describe('dedicated api routes', () => {
275275 await repo . findOneByOrFail ( { userId : '1' } ) ! ,
276276 ) ;
277277 delete expected [ 'userId' ] ;
278+ delete expected [ 'flags' ] ;
278279
279280 loggedUser = '1' ;
280281 const res = await authorizeRequest (
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ const LOGGED_IN_BODY = {
114114 alerts : {
115115 ...BASE_BODY . alerts ,
116116 bootPopup : true ,
117+ flags : { } ,
117118 } ,
118119 accessToken : {
119120 expiresIn : expect . any ( String ) ,
Original file line number Diff line number Diff line change @@ -208,13 +208,17 @@ export const typeDefs = /* GraphQL */ `
208208` ;
209209
210210/**
211- * Remove the flags from the alerts object
211+ * Remove the non public flags from the alerts object
212212 * @param alerts
213213 */
214214export const saveReturnAlerts = ( alerts : Alerts ) => {
215- // eslint-disable-next-line @typescript-eslint/no-unused-vars
216215 const { flags, ...data } = alerts ;
217- return data ;
216+ return {
217+ ...data ,
218+ flags : {
219+ hasSeenOpportunity : flags ?. hasSeenOpportunity ,
220+ } ,
221+ } ;
218222} ;
219223
220224interface GQLAlertInputInternalInput {
You can’t perform that action at this time.
0 commit comments