placeBet: always run 1 instance
This commit is contained in:
parent
8867d841cb
commit
62ea1bab15
|
@ -5,11 +5,13 @@ import { Contract } from './types/contract'
|
|||
import { User } from './types/user'
|
||||
import { Bet } from './types/bet'
|
||||
|
||||
export const placeBet = functions.https.onCall(async (data: {
|
||||
export const placeBet = functions
|
||||
.runWith({ minInstances: 1 })
|
||||
.https.onCall(async (data: {
|
||||
amount: number
|
||||
outcome: string
|
||||
contractId: string
|
||||
}, context) => {
|
||||
}, context) => {
|
||||
const userId = context?.auth?.uid
|
||||
if (!userId)
|
||||
return { status: 'error', message: 'Not authorized' }
|
||||
|
@ -44,7 +46,7 @@ export const placeBet = functions.https.onCall(async (data: {
|
|||
|
||||
return { status: 'success' }
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const firestore = admin.firestore()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user