Add Schem Download

This commit is contained in:
2024-08-15 17:04:06 +02:00
parent fe37a70d26
commit a70b00ae14
3 changed files with 27 additions and 2 deletions

View File

@ -39,11 +39,11 @@ export class SchematicRepo {
}
public async getSchematicCodeInfo(code: string): Promise<Schematic> {
return await fetchWithToken(this.token, `/schem/download/${code}/info`).then(value => value.json()).then(SchematicSchema.parse);
return await fetchWithToken(this.token, `/download/${code}/info`).then(value => value.json()).then(SchematicSchema.parse);
}
public getSchematicDownloadUrl(code: string): string {
return `/schem/download/${code}`;
return `${import.meta.env.PUBLIC_API_SERVER}/download/${code}`;
}
public async uploadSchematic(name: string, content: string) {