New Code Editor and fun
This commit is contained in:
@ -6,19 +6,19 @@ export class SchematicRepo {
|
||||
constructor(private token: string) {}
|
||||
|
||||
public async getRootSchematicList(): Promise<SchematicList> {
|
||||
return await fetchWithToken(this.token, "/schem").then(value => value.json()).then(value => SchematicListSchema.parse(value));
|
||||
return await fetchWithToken(this.token, "/schem").then(value => value.json()).then(SchematicListSchema.parse);
|
||||
}
|
||||
|
||||
public async getSchematicList(id: number): Promise<SchematicList> {
|
||||
return await fetchWithToken(this.token, `/schem/${id}/list`).then(value => value.json()).then(value => SchematicListSchema.parse(value));
|
||||
return await fetchWithToken(this.token, `/schem/${id}/list`).then(value => value.json()).then(SchematicListSchema.parse);
|
||||
}
|
||||
|
||||
public async getSchematicInfo(id: number): Promise<SchematicInfo> {
|
||||
return await fetchWithToken(this.token, `/schem/${id}`).then(value => value.json()).then(value => SchematicInfoSchema.parse(value));
|
||||
return await fetchWithToken(this.token, `/schem/${id}`).then(value => value.json()).then(SchematicInfoSchema.parse);
|
||||
}
|
||||
|
||||
public async createDownload(id: number): Promise<SchematicCode> {
|
||||
return await fetchWithToken(this.token, `/schem/${id}/download`).then(value => value.json()).then(value => SchematicCodeSchema.parse(value));
|
||||
return await fetchWithToken(this.token, `/schem/${id}/download`).then(value => value.json()).then(SchematicCodeSchema.parse);
|
||||
}
|
||||
|
||||
public async uploadSchematic(name: string, content: string) {
|
||||
|
||||
Reference in New Issue
Block a user