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); 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/`) return this.get(`/api/workspaces/${workspaceSlug}/projects/${projectID}/project-deploy-boards/`)
.then((response) => response?.data) .then((response) => response?.data)
.catch((error) => { .catch((error) => {
@ -18,7 +18,7 @@ export class ProjectPublishService extends APIService {
}); });
} }
async createProjectSettingsAsync( async publishProject(
workspaceSlug: string, workspaceSlug: string,
projectID: string, projectID: string,
data: Partial<TPublishSettings> data: Partial<TPublishSettings>
@ -30,7 +30,7 @@ export class ProjectPublishService extends APIService {
}); });
} }
async updateProjectSettingsAsync( async updatePublishSettings(
workspaceSlug: string, workspaceSlug: string,
projectID: string, projectID: string,
project_publish_id: 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( return this.delete(
`/api/workspaces/${workspaceSlug}/projects/${projectID}/project-deploy-boards/${project_publish_id}/` `/api/workspaces/${workspaceSlug}/projects/${projectID}/project-deploy-boards/${project_publish_id}/`
) )

View File

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