mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 19:33:46 +00:00
use api directly
This commit is contained in:
@@ -464,7 +464,7 @@ export const postNew: RequestHandler = async (req, res) => {
|
||||
*/
|
||||
export async function previewSheet(req, res) {
|
||||
try {
|
||||
const { id, worksheet } = req.data;
|
||||
const { id, worksheet } = req.body;
|
||||
const data = await Sheet.pull(id, worksheet);
|
||||
res.status(200).send(data);
|
||||
} catch (error) {
|
||||
@@ -528,7 +528,6 @@ export async function sheetAuthUrl(req, res) {
|
||||
* @method POST
|
||||
*/
|
||||
export const getSheetState = async (req, res) => {
|
||||
console.log('getstate', req.body);
|
||||
const { id, worksheet } = req.body;
|
||||
res.status(200).send(await Sheet.getSheetState(id, worksheet));
|
||||
};
|
||||
|
||||
@@ -155,8 +155,8 @@ export const validatePatchProjectFile = [
|
||||
|
||||
//TODO: is thise correct
|
||||
export const validateSheetParams = [
|
||||
body('sheetid').isString().optional({ nullable: false }),
|
||||
body('worksheet').isString().optional({ nullable: false }),
|
||||
body('id').exists().isString(),
|
||||
body('worksheet').exists().isString(),
|
||||
(req, res, next) => {
|
||||
const errors = validationResult(req);
|
||||
if (!errors.isEmpty()) return res.status(422).json({ errors: errors.array() });
|
||||
|
||||
Reference in New Issue
Block a user