-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateStatus.js
More file actions
18 lines (17 loc) · 835 Bytes
/
Copy pathupdateStatus.js
File metadata and controls
18 lines (17 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const functions = require('firebase-functions');
const config = require('../shared/config');
const { firebase, db } = require('../shared/admin.js');
const { checkArguments } = require('../shared/helpers.js');
const updateStatusQualifyingTest = require('../actions/qualifyingTests/updateStatusQualifyingTest')(config, firebase, db);
module.exports = functions.region('europe-west2').https.onCall(async (data, context) => {
if (!context.auth) {
throw new functions.https.HttpsError('failed-precondition', 'The function must be called while authenticated.');
}
if (!checkArguments({
applicationIds: { required: true },
applicationStatus: { required: true },
}, data)) {
throw new functions.https.HttpsError('invalid-argument', 'Please provide valid arguments');
}
return updateStatusQualifyingTest(data);
});