mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 02:43:50 +00:00
push to sheet
This commit is contained in:
@@ -265,3 +265,14 @@ export const postPreviewSheet = async (sheetId: string, worksheet: string, optio
|
||||
});
|
||||
return response.data.data;
|
||||
};
|
||||
|
||||
export const postPushSheet = async (sheetId: string, worksheet: string, options?: ExcelImportMap) => {
|
||||
const response = await axios.post(`${ontimeURL}/sheet-push`, {
|
||||
sheetid: sheetId,
|
||||
worksheet: worksheet,
|
||||
options: options,
|
||||
});
|
||||
return response.data.data;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
postPreviewSheet,
|
||||
uploadSheetClientFile,
|
||||
patchData,
|
||||
postPushSheet,
|
||||
} from '../../../common/api/ontimeApi';
|
||||
import { OntimeRundown, ProjectData, UserFields } from 'ontime-types';
|
||||
|
||||
@@ -88,6 +89,12 @@ export default function SheetsModal(props: SheetsModalProps) {
|
||||
});
|
||||
};
|
||||
|
||||
const handlePushData = () => {
|
||||
postPushSheet(sheetid.current?.value ?? '', worksheet.current?.value ?? '').then((data) => {
|
||||
console.log(data);
|
||||
});
|
||||
};
|
||||
|
||||
const handleFinalise = async () => {
|
||||
// this step is currently only used for excel files, after preview
|
||||
if (rundown && userFields && project) {
|
||||
@@ -181,6 +188,9 @@ export default function SheetsModal(props: SheetsModalProps) {
|
||||
<Button variant='ontime-filled' padding='0 2em' onClick={handlePullData}>
|
||||
Pull data
|
||||
</Button>
|
||||
<Button variant='ontime-filled' padding='0 2em' onClick={handlePushData}>
|
||||
Push data
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user