chore: rename service names

This commit is contained in:
Aaryan Khandelwal 2024-06-06 12:10:31 +05:30
parent 5c15a2ea20
commit 5c28a58e52
2 changed files with 8 additions and 12 deletions

View File

@ -10,7 +10,7 @@ export class ProjectPublishService extends APIService {
super(API_BASE_URL);
}
async getProjectSettingsAsync(workspaceSlug: string, projectID: string): Promise<TPublishSettings> {
async fetchPublishSettings(workspaceSlug: string, projectID: string): Promise<TPublishSettings> {
return this.get(`/api/workspaces/${workspaceSlug}/projects/${projectID}/project-deploy-boards/`)
.then((response) => response?.data)
.catch((error) => {
@ -18,7 +18,7 @@ export class ProjectPublishService extends APIService {
});
}
async createProjectSettingsAsync(
async publishProject(
workspaceSlug: string,
projectID: string,
data: Partial<TPublishSettings>
@ -30,7 +30,7 @@ export class ProjectPublishService extends APIService {
});
}
async updateProjectSettingsAsync(
async updatePublishSettings(
workspaceSlug: string,
projectID: string,
project_publish_id: string,
@ -46,7 +46,7 @@ export class ProjectPublishService extends APIService {
});
}
async deleteProjectSettingsAsync(workspaceSlug: string, projectID: string, project_publish_id: string): Promise<any> {
async unpublishProject(workspaceSlug: string, projectID: string, project_publish_id: string): Promise<any> {
return this.delete(
`/api/workspaces/${workspaceSlug}/projects/${projectID}/project-deploy-boards/${project_publish_id}/`
)

View File

@ -81,7 +81,7 @@ export class ProjectPublishStore implements IProjectPublishStore {
runInAction(() => {
this.fetchSettingsLoader = true;
});
const response = await this.projectPublishService.getProjectSettingsAsync(workspaceSlug, projectID);
const response = await this.projectPublishService.fetchPublishSettings(workspaceSlug, projectID);
runInAction(() => {
set(this.publishSettingsMap, [projectID], response);
@ -108,7 +108,7 @@ export class ProjectPublishStore implements IProjectPublishStore {
runInAction(() => {
this.generalLoader = true;
});
const response = await this.projectPublishService.createProjectSettingsAsync(workspaceSlug, projectID, data);
const response = await this.projectPublishService.publishProject(workspaceSlug, projectID, data);
runInAction(() => {
set(this.publishSettingsMap, [projectID], response);
set(this.projectRootStore.project.projectMap, [projectID, "is_deployed"], true);
@ -141,7 +141,7 @@ export class ProjectPublishStore implements IProjectPublishStore {
runInAction(() => {
this.generalLoader = true;
});
const response = await this.projectPublishService.updateProjectSettingsAsync(
const response = await this.projectPublishService.updatePublishSettings(
workspaceSlug,
projectID,
projectPublishId,
@ -172,11 +172,7 @@ export class ProjectPublishStore implements IProjectPublishStore {
runInAction(() => {
this.generalLoader = true;
});
const response = await this.projectPublishService.deleteProjectSettingsAsync(
workspaceSlug,
projectID,
projectPublishId
);
const response = await this.projectPublishService.unpublishProject(workspaceSlug, projectID, projectPublishId);
runInAction(() => {
unset(this.publishSettingsMap, [projectID]);
set(this.projectRootStore.project.projectMap, [projectID, "is_deployed"], false);