webstudio/ui/src/features/all_projects/data/project_repository.ts

17 lines
636 B
TypeScript
Raw Normal View History

import { ActivePipeline } from "../../../core/model/active_pipeline";
import { HttpMethod, HttpRepository } from "../../../core/repository/http_repository";
2023-11-16 00:40:35 +03:00
import { IProjectModel } from "../model/project_model";
2023-11-10 12:06:40 +03:00
2023-11-16 00:40:35 +03:00
export class ProjectRepository extends HttpRepository {
async getAllProject() {
return this._jsonRequest<IProjectModel[]>(HttpMethod.GET, "/project_instance");
2023-11-16 00:40:35 +03:00
}
2023-11-20 00:48:40 +03:00
async getActivePipeline() {
return this._jsonRequest<ActivePipeline>(HttpMethod.GET, "/realtime");
}
async setActivePipeline(id: string) {
return this._jsonRequest(HttpMethod.POST, `/project_instance/set/active/project?id=${id}`);
2023-11-20 00:48:40 +03:00
}
2023-11-16 00:40:35 +03:00
}