push to sheet

This commit is contained in:
arc-alex
2023-11-19 17:04:14 +01:00
parent a7c9ce876c
commit 543e365f82
5 changed files with 162 additions and 41 deletions
@@ -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>
</>
)}