Fix typing issues
This commit is contained in:
parent
dce39a79d9
commit
5bde99bc42
|
@ -1,5 +1,6 @@
|
|||
rules_version = '2';
|
||||
|
||||
// To pick the right project: `firebase projects:list`, then `firebase use <project-name>`
|
||||
// To deploy: `firebase deploy --only firestore:rules`
|
||||
service cloud.firestore {
|
||||
match /databases/{database}/documents {
|
||||
|
|
|
@ -13,7 +13,7 @@ export const transact = functions
|
|||
|
||||
const { amount, fromType, fromId, toId, toType, description } = data
|
||||
|
||||
if (fromType !== 'user')
|
||||
if (fromType !== 'USER')
|
||||
return {
|
||||
status: 'error',
|
||||
message: "From type is only implemented for type 'user'.",
|
||||
|
@ -44,7 +44,7 @@ export const transact = functions
|
|||
}
|
||||
}
|
||||
|
||||
if (toType === 'user') {
|
||||
if (toType === 'USER') {
|
||||
const toDoc = firestore.doc(`users/${toId}`)
|
||||
const toSnap = await transaction.get(toDoc)
|
||||
if (!toSnap.exists) {
|
||||
|
@ -66,6 +66,9 @@ export const transact = functions
|
|||
toType,
|
||||
|
||||
amount,
|
||||
// TODO: Unhardcode once we have non-donation txns
|
||||
token: 'M$',
|
||||
category: 'CHARITY',
|
||||
description,
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user