You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The most notable example of this is when creating/updating observations that have attachments. Right now, the end-user has to work with the relevant write hook to create the attachment(s) prior to creating the observation e.g.
constcreateBlob=useCreateBlob(...)constcreateObservation=useCreateDoc({docType: 'observation', ... })// Example of a single attachmentfunctiononPress(){createBlob.mutate(...,{onSuccess: (blob)=>{// Create observation that references blob after its creationcreateObservation.mutate({value: {attachments: [{ ...blob,driveDiscoveryId: blob.driveId}]}, ...})}})}// Example of multiple attachmentsfunctiononPress(){constblobs=awaitPromise.all([// Necessary if using useCreateBlob() because we don't expose a Promise-based method like React Query's `mutateAsync()`newPromise((res,rej)=>createBlob.mutate(...,{onSuccess: res,onError: rej})),newPromise((res,rej)=>createBlob.mutate(...,{onSuccess: res,onError: rej})),])// Create observation that has multiple attachmentscreateObservation.mutate({value: {attachments: blobs.map((b)=>({ ...b,driveDiscoveryId: blob.driveId})), ... }})}
The idea would be to have something similar to what the original issue outlined such that the end-user code could look more like this:
As mentioned in #26, I didn't figure out a satisfactory way of implementing this and decided to leave that as a follow-up, since it's mostly for end-usage convenience.
The text was updated successfully, but these errors were encountered:
Extracted from #20
The most notable example of this is when creating/updating observations that have attachments. Right now, the end-user has to work with the relevant write hook to create the attachment(s) prior to creating the observation e.g.
The idea would be to have something similar to what the original issue outlined such that the end-user code could look more like this:
As mentioned in #26, I didn't figure out a satisfactory way of implementing this and decided to leave that as a follow-up, since it's mostly for end-usage convenience.
The text was updated successfully, but these errors were encountered: