Merge pull request #2402 from constantine2nd/develop

Tweak endpoint getConsentByConsentId v5.1.0
This commit is contained in:
Simon Redfern 2024-06-19 09:12:22 +02:00 committed by GitHub
commit b15798e05d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -994,9 +994,9 @@ trait APIMethods510 {
cc => implicit val ec = EndpointContext(Some(cc))
for {
consent <- Future { Consents.consentProvider.vend.getConsentByConsentId(consentId)} map {
unboxFullOrFail(_, cc.callContext, ConsentNotFound)
unboxFullOrFail(_, cc.callContext, ConsentNotFound, 404)
}
_ <- Helper.booleanToFuture(failMsg = ConsentNotFound, cc = cc.callContext) {
_ <- Helper.booleanToFuture(failMsg = ConsentNotFound, failCode = 404, cc = cc.callContext) {
consent.mUserId == cc.userId
}
} yield {