File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -27,21 +27,14 @@ export default functions.firestore.document("users/{userId}/messages/{messageId}
2727 let boat = { }
2828 let wgs = { }
2929
30- let user = ( await USERS_FS . doc ( userId ) . get ( ) ) . data ( ) // Fetch last serial number
31-
32- const RN = user . RN ? user . RN + 1 : 1
33-
34- const batch = firestore . batch ( )
35- batch . update ( USERS_FS . doc ( userId ) , { RN } )
36- batch . update ( MESSAGES_FS ( userId ) . doc ( messageId ) , { RN , eventId} )
37- await batch . commit ( )
30+ await MESSAGES_FS ( userId ) . doc ( messageId ) . update ( { eventId} )
3831
3932 const boatQuery = await BOATS_FS . where ( "userId" , "==" , userId ) . get ( )
4033 boatQuery . docs . forEach ( b => { if ( b . exists ) boat = b . data ( ) } )
4134
4235 let message = {
4336 TM : m . TM ,
44- RN ,
37+ RN : m . RN ,
4538 AD : "NOR" ,
4639 RC : boat . RC ,
4740 NA : boat . NA ,
You can’t perform that action at this time.
0 commit comments