bb-plane-fork/space/core/services/publish.service.ts
sriram veeraghanta fa3aa362a9 fix: lint errors
2024-12-04 17:22:41 +05:30

28 lines
874 B
TypeScript

import { API_BASE_URL } from "@plane/constants";
import { TProjectPublishSettings } from "@plane/types";
// services
import { APIService } from "@/services/api.service";
class PublishService extends APIService {
constructor() {
super(API_BASE_URL);
}
async fetchPublishSettings(anchor: string): Promise<TProjectPublishSettings> {
return this.get(`/api/public/anchor/${anchor}/settings/`)
.then((response) => response?.data)
.catch((error) => {
throw error?.response;
});
}
async fetchAnchorFromProjectDetails(workspaceSlug: string, projectID: string): Promise<TProjectPublishSettings> {
return this.get(`/api/public/workspaces/${workspaceSlug}/projects/${projectID}/anchor/`)
.then((response) => response?.data)
.catch((error) => {
throw error?.response;
});
}
}
export default PublishService;