Project Manager: Quick Start (#762)

This commit is contained in:
Ary
2024-02-10 06:30:33 -07:00
committed by GitHub
parent 7f78fac162
commit 12f81c63ce
11 changed files with 219 additions and 263 deletions
+8 -11
View File
@@ -247,13 +247,6 @@ export async function getLatestVersion(): Promise<HasUpdate> {
};
}
/**
* @description HTTP POST request to create a new project file with given project data
*/
export async function postNew(initialData: Partial<ProjectData>) {
return axios.post(`${ontimeURL}/new`, initialData);
}
/**
* @description HTTP request to get the list of available project files
*/
@@ -382,11 +375,15 @@ export async function deleteProject(filename: string): Promise<MessageResponse>
/**
* @description HTTP request to create a project file
*/
export async function createProject(filename: string): Promise<MessageResponse> {
export async function createProject(
project: Partial<
ProjectData & {
filename: string;
}
>,
): Promise<MessageResponse> {
const url = `${ontimeURL}/project`;
const decodedUrl = decodeURIComponent(url);
const res = await axios.post(decodedUrl, {
filename,
});
const res = await axios.post(decodedUrl, project);
return res.data;
}