Skip to content

Commit

Permalink
Fix API call createProjectBranchBackend -> createProjectBranchRuntime (
Browse files Browse the repository at this point in the history
  • Loading branch information
octref authored Jan 21, 2025
1 parent ee47e9f commit 3171402
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/util/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@ export async function sendMapRepoAndFinishProjectCreationReq(jwt: string, id: st
export async function sendCreateProjectReq(jwt: string, orgId: string, projectName: string, repoId: string, repoName: string): Promise<Project> {
const slug = getSlugFromName(projectName);
const query = `
mutation CreateProjectBranchBackend {
createProjectBranchBackend(input: {orgId: "${orgId}", clusterId: "clu-018f07d5-2446-7dbe-a766-dfab00c726de", name: "${projectName}", slug: "${slug}", repoId: "${repoId}", repoName: "${repoName}", sourceType: CUSTOM, defaultBranchName: "main"}
mutation CreateProjectBranchRuntime {
createProjectBranchRuntime(input: {orgId: "${orgId}", clusterId: "clu-018f07d5-2446-7dbe-a766-dfab00c726de", name: "${projectName}", slug: "${slug}", repoId: "${repoId}", repoName: "${repoName}", sourceType: CUSTOM, defaultBranchName: "main"}
) {
id
name
repoId
}
}`;

const data: any = await sendGraphQLReqToHypermode(jwt, query);
const res: any = await sendGraphQLReqToHypermode(jwt, query);

const project: Project = data.data.createProjectBranchBackend;
const project: Project = res.data.createProjectBranchRuntime;

return project;
}
Expand Down Expand Up @@ -120,11 +120,11 @@ export async function sendGetRepoIdReq(jwt: string, installationId: string, gitU
getUserRepoIdByUrl(installationId: "${installationId}", gitUrl: "${gitUrl}")
}`;

const data: any = await sendGraphQLReqToHypermode(jwt, query);
const res: any = await sendGraphQLReqToHypermode(jwt, query);

if (!data.data.getUserRepoIdByUrl) {
if (!res.data.getUserRepoIdByUrl) {
throw new Error("No repoId found for the given installationId and gitUrl");
}

return data.data.getUserRepoIdByUrl;
return res.data.getUserRepoIdByUrl;
}

0 comments on commit 3171402

Please sign in to comment.