Merge pull request #760 from snake-eaterr/pass-null-to-empty-rules

pass null to empty rules
This commit is contained in:
Justin (shocknet) 2024-10-05 15:45:45 -04:00 committed by GitHub
commit 91c6929abf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,7 +41,7 @@ export default class {
return this.DB.getRepository(DebitAccess).update({ app_user_id: appUserId, npub: authorizedPub }, { authorized }) return this.DB.getRepository(DebitAccess).update({ app_user_id: appUserId, npub: authorizedPub }, { authorized })
} }
async UpdateDebitAccessRules(appUserId: string, authorizedPub: string, rules?: DebitAccessRules) { async UpdateDebitAccessRules(appUserId: string, authorizedPub: string, rules?: DebitAccessRules) {
return this.DB.getRepository(DebitAccess).update({ app_user_id: appUserId, npub: authorizedPub }, { rules }) return this.DB.getRepository(DebitAccess).update({ app_user_id: appUserId, npub: authorizedPub }, { rules: rules || null })
} }
async DenyDebitAccess(appUserId: string, pub: string) { async DenyDebitAccess(appUserId: string, pub: string) {