@@ -3,6 +3,7 @@ import { internalAction, internalMutation } from "./functions.js";
33import { internal } from "./_generated/api.js" ;
44import { Id } from "./_generated/dataModel.js" ;
55import { ensureCoordinator } from "./helpers.js" ;
6+ import { notificationFields } from "./schema.js" ;
67
78export const markNotificationState = internalMutation ( {
89 args : {
@@ -148,21 +149,17 @@ export const coordinateSendingPushNotifications = internalMutation({
148149 _contentAvailable : n . metadata . _contentAvailable ?? undefined ,
149150 data : n . metadata . data ?? undefined ,
150151 title : n . metadata . title ,
151- subtitle : n . metadata . subtitle ?? undefined ,
152152 body : n . metadata . body ?? undefined ,
153153 ttl : n . metadata . ttl ?? undefined ,
154154 expiration : n . metadata . expiration ?? undefined ,
155155 priority : n . metadata . priority ?? undefined ,
156- // subtitle: n.metadata.subtitle ?? undefined,
156+ subtitle : n . metadata . subtitle ?? undefined ,
157157 sound : n . metadata . sound ?? "default" ,
158158 badge : n . metadata . badge ?? undefined ,
159159 interruptionLevel : n . metadata . interruptionLevel ?? undefined ,
160160 channelId : n . metadata . channelId ?? undefined ,
161161 categoryId : n . metadata . categoryId ?? undefined ,
162162 mutableContent : n . metadata . mutableContent ?? undefined ,
163- // sound: n.metadata.sound ?? "default",
164- // data: n.metadata.data ?? undefined,
165- categoryIdentifier : n . metadata . categoryIdentifier ?? undefined ,
166163 } ,
167164 _id : n . _id ,
168165 } ;
@@ -207,13 +204,7 @@ export const action_sendPushNotifications = internalAction({
207204 v . object ( {
208205 message : v . object ( {
209206 to : v . string ( ) ,
210- title : v . string ( ) ,
211- subtitle : v . optional ( v . string ( ) ) ,
212- body : v . optional ( v . string ( ) ) ,
213- sound : v . string ( ) ,
214- data : v . optional ( v . any ( ) ) ,
215- channelId : v . optional ( v . string ( ) ) ,
216- categoryIdentifier : v . optional ( v . string ( ) ) ,
207+ ...notificationFields
217208 } ) ,
218209 _id : v . id ( "notifications" ) ,
219210 } )
0 commit comments