RGMMX4YQP6NPCPFAGZ5SRITSPJQW4F77S6RJLYJMS3D732LUGDPQC
ZI2RJOZ2HXBHX7L54BTSDKESY6NG5KBJLVHCNY7K7ZLGIUOIHQUQC
4WREYORZT3SWUXADWHSS6B4PQSP3QSLH77CGNKRH6IRKUMX4TARAC
TBTYGTE3JUKOX6GDBR7AMMMV4RYCUFAK5N3ATSVCLCGESBSMJUHQC
WYTMZJFYVKHR4QH7AV5JUNWXT6NAC5NNQNPZCQSDI6LGI7DVXFYAC
4ADMC3SGJNATDR6D7WXHNZ6RD5F5BUPLPRMCEUERWRWKVZQVAO3AC
UCY5PVFCT2QIOGR47KFS4KBF2ZPHRBOAIOH6PJEVWCHLMBRBLOMQC
EGNRBQUMOZHAF5B7KCMTAPMB4H3USK4MK33Q6T5V26D6HOJNW6LQC
if(fuck2.status === 200) {//this should be wrapped in a transaction.... and ensure end > start in db
let store = await pool.query('insert into store values (default, $1, $2, $3, $4, $5, $6, $7, $8, point($9, $10), $11) returning id', [
if(fuck2.status === 200) {//https://stackoverflow.com/questions/20561254
let store = await pool.query('insert into store (name, URL, address, address2, city, region, country, postal_code, coordinate, timezone) values ($1, $2, $3, $4, $5, $6, $7, $8, point($9, $10), $11) returning id', [
params.push(parameters.times[i].day);
params.push(parameters.times[i].start);
params.push(parameters.times[i].end);
let ts = parameters.times[i].time_start.split(':');
ts = Number(parameters.times[i].day_start) * 1440 + Number(ts[0]) * 60 + Number(ts[1]);
let te = parameters.times[i].time_end.split(':');
te = Number(parameters.times[i].day_end) * 1440 + Number(te[0]) * 60 + Number(te[1]);
params.push(`[${ts}, ${te})`);
}));
}
break;
case 'cloudinary_preset':
if(isLoggedIn(ws)) {
if(is(ws, 'god')) {// || is(ws, 'store owner')
ws.send(JSON.stringify({
response_ID: request_ID,
data: {cloudinary: process.env.CLOUDINARY}
}));
} else {
ws.send(JSON.stringify({
response_ID: request_ID,
data: 'forbidden'
}));
}
} else {
ws.send(JSON.stringify({
response_ID: request_ID,
data: 'unauthorized'