Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
currentHostBucket: userSession.loadUserData().username
}
const encryptedTeamForm = userSession.encryptContent(JSON.stringify(form), {publicKey: JSON.parse(fetchedKeys).public})
const teamForm = {
fileName: `teamForms/${data.teamId}/${singleForm.id}.json`,
encrypt: false,
body: JSON.stringify(encryptedTeamForm)
}
const postedTeamForm = await postData(teamForm);
console.log(postedTeamForm);
singleForm["teamForm"] = true;
let theseTeams = singleForm.teams;
singleForm.teams.includes(data.teamId) ? singleForm.teams = theseTeams : singleForm.teams.push(data.teamId);
await setGlobal({ singleForm });
if(data.fromSave) {
//Do nothing
} else {
await saveForm(false);
}
const privateKey = userSession.loadUserData().appPrivateKey;
const syncedForm = {
id: singleForm.id,
title: userSession.encryptContent(singleForm.title, {publicKey: JSON.parse(fetchedKeys).public}),
teamName: data.teamName ? userSession.encryptContent(data.teamName, {publicKey: JSON.parse(fetchedKeys).public}) : "",
orgId: proOrgInfo.orgId,
teamId: data.teamId,
lastUpdated: getMonthDayYear(),
timestamp: Date.now(),
export async function deleteQuestion(question) {
let singleForm = getGlobal().singleForm;
let questions = singleForm.questions;
let index = await questions.map((x) => {return x.id }).indexOf(question.id);
if(index > -1) {
questions.splice(index, 1);
singleForm["questios"] = questions;
setGlobal({ singleForm });
saveForm();
} else {
console.log("Error with index");
}
}
export async function deleteTag(tag) {
let tags = getGlobal().singleDocTags;
let index = await tags.map((x) => {return x }).indexOf(tag);
tags.splice(index, 1);
setGlobal({singleDocTags: tags})
}
export function addVaultTagManual() {
let tags = getGlobal().tags;
setGlobal({ tags: [...tags, getGlobal().tag]}, () => {
setGlobal({ tag: "" });
});
}
export function addFormTagManual() {
let tags = getGlobal().tags;
setGlobal({ tags: [...tags, getGlobal().tag]}, () => {
setGlobal({ tag: "" });
});
}