clean up sheet flow

This commit is contained in:
arc-alex
2023-11-24 17:47:21 +01:00
parent 111df94d6d
commit e8bcbb4291
6 changed files with 63 additions and 104 deletions
@@ -423,7 +423,7 @@ export const postNew: RequestHandler = async (req, res) => {
*/
export async function previewSheet(req, res) {
try {
const data = await Sheet.pull(req.body.sheetid, req.body.worksheet);
const data = await Sheet.pull();
res.status(200).send(data);
} catch (error) {
res.status(500).send({ message: error.toString() });
@@ -436,7 +436,7 @@ export async function previewSheet(req, res) {
*/
export async function pushSheet(req, res) {
try {
await Sheet.push(req.body.sheetid, req.body.worksheet);
await Sheet.push();
res.status(200).send('ok');
} catch (error) {
res.status(500).send({ message: error.toString() });
@@ -465,14 +465,6 @@ export async function uploadGoogleSheetClientFile(req, res) {
});
}
/**
* @returns sheet auth state
*/
export async function sheetAuthState(req, res) {
const send = (await Sheet.authorized()) ? 'true' : 'false';
res.status(200).send(send);
}
/**
* @returns link to sheet auth url
*/