mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +00:00
rename to pull
This commit is contained in:
@@ -398,7 +398,7 @@ export async function previewExcel(req, res) {
|
|||||||
*/
|
*/
|
||||||
export async function previewSheet(req, res) {
|
export async function previewSheet(req, res) {
|
||||||
try {
|
try {
|
||||||
const data = await Sheet.parse(req.body.sheetid, req.body.worksheet);
|
const data = await Sheet.pull(req.body.sheetid, req.body.worksheet);
|
||||||
res.status(200).send(data);
|
res.status(200).send(data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
res.status(500).send({ message: error.toString() });
|
res.status(500).send({ message: error.toString() });
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class sheet {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* `parse` a given sheet
|
* `parse` a given sheet
|
||||||
@@ -45,7 +46,7 @@ class sheet {
|
|||||||
* @returns {Promise<Partial<ResponseOK>>}
|
* @returns {Promise<Partial<ResponseOK>>}
|
||||||
* @throws
|
* @throws
|
||||||
*/
|
*/
|
||||||
public async parse(sheetId: string, worksheet: string, options = defaultExcelImportMap) {
|
public async pull(sheetId: string, worksheet: string, options = defaultExcelImportMap) {
|
||||||
if (!sheet.client) {
|
if (!sheet.client) {
|
||||||
if (!(await this.authorized())) {
|
if (!(await this.authorized())) {
|
||||||
throw new Error(`Sheet not authorized`);
|
throw new Error(`Sheet not authorized`);
|
||||||
|
|||||||
Reference in New Issue
Block a user