2024-02-04 13:12:53 +00:00
|
|
|
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() {
|
2024-02-04 13:12:53 +00:00
|
|
|
return this._jsonRequest<IProjectModel[]>(HttpMethod.GET, "/project_instance");
|
2023-11-16 00:40:35 +03:00
|
|
|
}
|
2024-02-04 13:12:53 +00:00
|
|
|
|
2023-11-20 00:48:40 +03:00
|
|
|
async getActivePipeline() {
|
2024-02-04 13:12:53 +00:00
|
|
|
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
|
|
|
}
|