2024-06-06 06:34:37 +00:00
|
|
|
// types
|
|
|
|
import { TPublishSettings } from "@plane/types";
|
|
|
|
// helpers
|
2024-06-05 14:38:03 +00:00
|
|
|
import { API_BASE_URL } from "@/helpers/common.helper";
|
|
|
|
// services
|
|
|
|
import { APIService } from "@/services/api.service";
|
|
|
|
|
|
|
|
class PublishService extends APIService {
|
|
|
|
constructor() {
|
|
|
|
super(API_BASE_URL);
|
|
|
|
}
|
|
|
|
|
|
|
|
async fetchPublishSettings(anchor: string): Promise<TPublishSettings> {
|
|
|
|
return this.get(`/api/public/anchor/${anchor}/settings/`)
|
|
|
|
.then((response) => response?.data)
|
|
|
|
.catch((error) => {
|
|
|
|
throw error?.response;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async fetchAnchorFromProjectDetails(workspaceSlug: string, projectID: string): Promise<TPublishSettings> {
|
|
|
|
return this.get(`/api/public/workspaces/${workspaceSlug}/projects/${projectID}/anchor/`)
|
|
|
|
.then((response) => response?.data)
|
|
|
|
.catch((error) => {
|
|
|
|
throw error?.response;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default PublishService;
|