import {ok, notFound, serverError, created} from 'wix-http-functions';
import wixData from 'wix-data';
import {fetch} from 'wix-fetch'
var Verified = {}
var test = false
async function ReturnValue(json) {
let options = {
"headers": {
"Content-Type": "application/json"
},
"body": JSON.stringify(json)
};
return ok(options)
}
export async function post_approveverify(request) {
const bodyjson = await request.body.json()
Verified[bodyjson.wixid] = Date.now()
test = true //This always runs before the checkverify function
console.log("changed test variable")
return ReturnValue({
"Success": true
})
}
export async function post_checkverify(request) {
const bodyjson = await request.body.json()
console.log(test) //Always prints false even after the value is set in the other function
return ReturnValue({
"Success": false
})
}
The variable “test” is not updating for some reason and I can’t figure out why.