Skip to content

Commit 6521281

Browse files
authored
Merge pull request #1091 from opencrvs/ocrvs-10561-b
fix: dont show birth certificate after first print
2 parents 5046a91 + 621e1e4 commit 6521281

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/api/certificates/handler.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
1010
*/
1111

12-
import { conditionals } from '@countryconfig/form/common/custom-validation-conditionals/custom-conditionals'
1312
import { Event } from '@countryconfig/form/types/types'
1413
import { Request, ResponseToolkit } from '@hapi/hapi'
15-
import { ActionType, event, field } from '@opencrvs/toolkit/events'
16-
import { x } from 'joi'
14+
import { ActionType, event, not } from '@opencrvs/toolkit/events'
1715

1816
type FontFamilyTypes = {
1917
normal: string
@@ -270,7 +268,7 @@ export async function certificateHandler(request: Request, h: ResponseToolkit) {
270268
conditionals: [
271269
{
272270
type: 'SHOW',
273-
conditional: field('child.dob').isAfter().days(365).inPast()
271+
conditional: not(event.hasAction(ActionType.PRINT_CERTIFICATE))
274272
}
275273
]
276274
},

0 commit comments

Comments
 (0)