We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 225f603 commit c6deabeCopy full SHA for c6deabe
plugins/controlled-documents-resources/src/utils.ts
@@ -443,11 +443,22 @@ export async function completeRequest (
443
return
444
}
445
446
- await client.update(req, {
+ const ops = client.apply(req._id)
447
+
448
+ // Check on the server side if the user has already approved - do not add the second time
449
+ // otherwise request is never finished and ends up in a broken state
450
+ ops.notMatch(reqClass, {
451
+ _id: req._id,
452
+ approved: me
453
+ })
454
455
+ await ops.update(req, {
456
$push: {
457
approved: me
458
459
})
460
461
+ await ops.commit()
462
463
464
export async function saveComment (message: Markup | undefined, req: DocumentRequest): Promise<void> {
0 commit comments