Skip to content

Commit

Permalink
chore: fixing applicationId to artifactId
Browse files Browse the repository at this point in the history
  • Loading branch information
brayn003 committed Jan 15, 2025
1 parent 93a1208 commit 16a685e
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 67 deletions.
10 changes: 5 additions & 5 deletions app/client/src/git/requests/fetchLocalProfileRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ async function fetchLocalProfileRequestOld(

async function fetchLocalProfileRequestNew(
artifactType: GitArtifactType,
baseApplicationId: string,
baseArtifactId: string,
): AxiosPromise<FetchLocalProfileResponse> {
return Api.get(
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${baseApplicationId}/profile`,
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${baseArtifactId}/profile`,
);
}

export default async function fetchLocalProfileRequest(
artifactType: GitArtifactType,
baseApplicationId: string,
baseArtifactId: string,
isNew: boolean,
): AxiosPromise<FetchLocalProfileResponse> {
if (isNew) {
return fetchLocalProfileRequestNew(artifactType, baseApplicationId);
return fetchLocalProfileRequestNew(artifactType, baseArtifactId);
} else {
return fetchLocalProfileRequestOld(baseApplicationId);
return fetchLocalProfileRequestOld(baseArtifactId);
}
}
14 changes: 5 additions & 9 deletions app/client/src/git/requests/fetchMergeStatusRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,24 @@ async function fetchMergeStatusRequestOld(

async function fetchMergeStatusRequestNew(
artifactType: GitArtifactType,
branchedApplicationId: string,
refArtifactId: string,
params: FetchMergeStatusRequestParams,
): AxiosPromise<FetchMergeStatusResponse> {
return Api.post(
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${branchedApplicationId}/merge/status`,
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${refArtifactId}/merge/status`,
params,
);
}

export default async function fetchMergeStatusRequest(
artifactType: GitArtifactType,
branchedApplicationId: string,
refArtifactId: string,
params: FetchMergeStatusRequestParams,
isNew: boolean,
): AxiosPromise<FetchMergeStatusResponse> {
if (isNew) {
return fetchMergeStatusRequestNew(
artifactType,
branchedApplicationId,
params,
);
return fetchMergeStatusRequestNew(artifactType, refArtifactId, params);
} else {
return fetchMergeStatusRequestOld(branchedApplicationId, params);
return fetchMergeStatusRequestOld(refArtifactId, params);
}
}
10 changes: 5 additions & 5 deletions app/client/src/git/requests/fetchMetadataRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ async function fetchMetadataRequestOld(

async function fetchMetadataRequestNew(
artifactType: GitArtifactType,
baseApplicationId: string,
baseArtifactId: string,
): AxiosPromise<FetchMetadataResponse> {
return Api.get(
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${baseApplicationId}/metadata`,
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${baseArtifactId}/metadata`,
);
}

export default async function fetchMetadataRequest(
artifactType: GitArtifactType,
baseApplicationId: string,
baseArtifactId: string,
isNew: boolean,
): AxiosPromise<FetchMetadataResponse> {
if (isNew) {
return fetchMetadataRequestNew(artifactType, baseApplicationId);
return fetchMetadataRequestNew(artifactType, baseArtifactId);
} else {
return fetchMetadataRequestOld(baseApplicationId);
return fetchMetadataRequestOld(baseArtifactId);
}
}
10 changes: 5 additions & 5 deletions app/client/src/git/requests/fetchProtectedBranchesRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ async function fetchProtectedBranchesRequestOld(

async function fetchProtectedBranchesRequestNew(
artifactType: GitArtifactType,
baseApplicationId: string,
baseArtifactId: string,
): AxiosPromise<FetchProtectedBranchesResponse> {
return Api.get(
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${baseApplicationId}/protected`,
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${baseArtifactId}/protected`,
);
}

export default async function fetchProtectedBranchesRequest(
artifactType: GitArtifactType,
baseApplicationId: string,
baseArtifactId: string,
isNew: boolean,
): AxiosPromise<FetchProtectedBranchesResponse> {
if (isNew) {
return fetchProtectedBranchesRequestNew(artifactType, baseApplicationId);
return fetchProtectedBranchesRequestNew(artifactType, baseArtifactId);
} else {
return fetchProtectedBranchesRequestOld(baseApplicationId);
return fetchProtectedBranchesRequestOld(baseArtifactId);
}
}
4 changes: 2 additions & 2 deletions app/client/src/git/requests/fetchSSHKeyRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Api from "api/Api";
import { APPLICATION_BASE_URL } from "./constants";

export default async function fetchSSHKeyRequest(
baseApplicationId: string,
baseArtifactId: string,
): AxiosPromise<FetchSSHKeyResponse> {
return Api.get(`${APPLICATION_BASE_URL}/ssh-keypair/${baseApplicationId}`);
return Api.get(`${APPLICATION_BASE_URL}/ssh-keypair/${baseArtifactId}`);
}
10 changes: 5 additions & 5 deletions app/client/src/git/requests/fetchStatusRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ async function fetchStatusRequestOld(

async function fetchStatusRequestNew(
artifactType: GitArtifactType,
branchedApplicationId: string,
baseArtifactId: string,
params: FetchStatusRequestParams,
): AxiosPromise<FetchStatusResponse> {
return Api.get(
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${branchedApplicationId}/status`,
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${baseArtifactId}/status`,
params,
);
}

export default async function fetchStatusRequest(
artifactType: GitArtifactType,
branchedApplicationId: string,
baseArtifactId: string,
params: FetchStatusRequestParams,
isNew: boolean,
): AxiosPromise<FetchStatusResponse> {
if (isNew) {
return fetchStatusRequestNew(artifactType, branchedApplicationId, params);
return fetchStatusRequestNew(artifactType, baseArtifactId, params);
} else {
return fetchStatusRequestOld(branchedApplicationId, params);
return fetchStatusRequestOld(baseArtifactId, params);
}
}
4 changes: 2 additions & 2 deletions app/client/src/git/requests/generateSSHKeyRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { APPLICATION_BASE_URL } from "./constants";
import Api from "api/Api";

export default async function generateSSHKeyRequest(
baseApplicationId: string,
baseArtifactId: string,
params: GenerateSSHKeyRequestParams,
): AxiosPromise<GenerateSSHKeyResponse> {
const url = `${APPLICATION_BASE_URL}/ssh-keypair/${baseApplicationId}?keyType=${params.keyType}`;
const url = `${APPLICATION_BASE_URL}/ssh-keypair/${baseArtifactId}?keyType=${params.keyType}`;

return Api.post(url);
}
10 changes: 5 additions & 5 deletions app/client/src/git/requests/mergeRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ async function mergeRequestOld(

async function mergeRequestNew(
artifactType: GitArtifactType,
branchedApplicationId: string,
refArtifactId: string,
params: MergeRequestParams,
): AxiosPromise<MergeResponse> {
return Api.post(
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${branchedApplicationId}/merge`,
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${refArtifactId}/merge`,
params,
);
}

export default async function mergeRequest(
artifactType: GitArtifactType,
branchedApplicationId: string,
refArtifactId: string,
params: MergeRequestParams,
isNew: boolean,
): AxiosPromise<MergeResponse> {
if (isNew) {
return mergeRequestNew(artifactType, branchedApplicationId, params);
return mergeRequestNew(artifactType, refArtifactId, params);
} else {
return mergeRequestOld(branchedApplicationId, params);
return mergeRequestOld(refArtifactId, params);
}
}
10 changes: 5 additions & 5 deletions app/client/src/git/requests/pullRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ async function pullRequestOld(

async function pullRequestNew(
artifactType: GitArtifactType,
branchedApplicationId: string,
refArtifactId: string,
): AxiosPromise<PullResponse> {
return Api.get(
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${branchedApplicationId}/pull`,
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${refArtifactId}/pull`,
);
}

export default async function pullRequest(
artifactType: GitArtifactType,
branchedApplicationId: string,
refArtifactId: string,
isNew: boolean,
): AxiosPromise<PullResponse> {
if (isNew) {
return pullRequestNew(artifactType, branchedApplicationId);
return pullRequestNew(artifactType, refArtifactId);
} else {
return pullRequestOld(branchedApplicationId);
return pullRequestOld(refArtifactId);
}
}
10 changes: 5 additions & 5 deletions app/client/src/git/requests/toggleAutocommitRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ async function toggleAutocommitRequestOld(

async function toggleAutocommitRequestNew(
artifactType: GitArtifactType,
baseApplicationId: string,
baseArtifactId: string,
): AxiosPromise<ToggleAutocommitResponse> {
return Api.patch(
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${baseApplicationId}/auto-commit/toggle`,
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${baseArtifactId}/auto-commit/toggle`,
);
}

export default async function toggleAutocommitRequest(
artifactType: GitArtifactType,
baseApplicationId: string,
baseArtifactId: string,
isNew: boolean,
): AxiosPromise<ToggleAutocommitResponse> {
if (isNew) {
return toggleAutocommitRequestNew(artifactType, baseApplicationId);
return toggleAutocommitRequestNew(artifactType, baseArtifactId);
} else {
return toggleAutocommitRequestOld(baseApplicationId);
return toggleAutocommitRequestOld(baseArtifactId);
}
}
10 changes: 5 additions & 5 deletions app/client/src/git/requests/triggerAutocommitRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ async function triggerAutocommitRequestOld(

async function triggerAutocommitRequestNew(
artifactType: GitArtifactType,
branchedApplicationId: string,
refArtifactId: string,
): AxiosPromise<TriggerAutocommitResponse> {
return Api.post(
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${branchedApplicationId}/auto-commit`,
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${refArtifactId}/auto-commit`,
);
}

export default async function triggerAutocommitRequest(
artifactType: GitArtifactType,
branchedApplicationId: string,
refArtifactId: string,
isNew: boolean,
): AxiosPromise<TriggerAutocommitResponse> {
if (isNew) {
return triggerAutocommitRequestNew(artifactType, branchedApplicationId);
return triggerAutocommitRequestNew(artifactType, refArtifactId);
} else {
return triggerAutocommitRequestOld(branchedApplicationId);
return triggerAutocommitRequestOld(refArtifactId);
}
}
14 changes: 5 additions & 9 deletions app/client/src/git/requests/updateLocalProfileRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,24 @@ async function updateLocalProfileRequestOld(

async function updateLocalProfileRequestNew(
artifactType: GitArtifactType,
baseApplicationId: string,
baseArtifactId: string,
params: UpdateLocalProfileRequestParams,
): AxiosPromise<UpdateLocalProfileResponse> {
return Api.put(
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${baseApplicationId}/profile`,
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${baseArtifactId}/profile`,
params,
);
}

export default async function updateLocalProfileRequest(
artifactType: GitArtifactType,
baseApplicationId: string,
baseArtifactId: string,
params: UpdateLocalProfileRequestParams,
isNew: boolean,
): AxiosPromise<UpdateLocalProfileResponse> {
if (isNew) {
return updateLocalProfileRequestNew(
artifactType,
baseApplicationId,
params,
);
return updateLocalProfileRequestNew(artifactType, baseArtifactId, params);
} else {
return updateLocalProfileRequestOld(baseApplicationId, params);
return updateLocalProfileRequestOld(baseArtifactId, params);
}
}
10 changes: 5 additions & 5 deletions app/client/src/git/requests/updateProtectedBranchesRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ async function updateProtectedBranchesRequestOld(

async function updateProtectedBranchesRequestNew(
artifactType: GitArtifactType,
baseApplicationId: string,
baseArtifactId: string,
params: UpdateProtectedBranchesRequestParams,
): AxiosPromise<UpdateProtectedBranchesResponse> {
return Api.post(
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${baseApplicationId}/protected`,
`${GIT_BASE_URL}/${urlArtifactType(artifactType)}/${baseArtifactId}/protected`,
params,
);
}

export default async function updateProtectedBranchesRequest(
artifactType: GitArtifactType,
baseApplicationId: string,
baseArtifactId: string,
params: UpdateProtectedBranchesRequestParams,
isNew: boolean,
): AxiosPromise<UpdateProtectedBranchesResponse> {
if (isNew) {
return updateProtectedBranchesRequestNew(
artifactType,
baseApplicationId,
baseArtifactId,
params,
);
} else {
return updateProtectedBranchesRequestOld(baseApplicationId, params);
return updateProtectedBranchesRequestOld(baseArtifactId, params);
}
}

0 comments on commit 16a685e

Please sign in to comment.