Skip to content

Commit

Permalink
Add getProjectMetadataByName
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb committed Feb 9, 2023
1 parent 8d030ac commit 91e06dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions dist/cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -2280,11 +2280,12 @@ class Cloud {

async getProjectByName(owner, name) {
const response = await this.fetch(`/projects/user/${owner}/${name}`);
// FIXME: This is returning an empty response sometimes
const project = await response.json();
this.setLocalState(project.ProjectID, project.RoleID);
console.assert(project.ProjectID, 'Response does not have a project ID');
return project;
return await response.json();
};

async getProjectMetadataByName(owner, name) {
const response = await this.fetch(`/projects/user/${owner}/${name}/metadata`);
return await response.json();
};

async startNetworkTrace(projectId) {
Expand Down
11 changes: 6 additions & 5 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,12 @@ class Cloud {

async getProjectByName(owner, name) {
const response = await this.fetch(`/projects/user/${owner}/${name}`);
// FIXME: This is returning an empty response sometimes
const project = await response.json();
this.setLocalState(project.ProjectID, project.RoleID);
console.assert(project.ProjectID, 'Response does not have a project ID');
return project;
return await response.json();
};

async getProjectMetadataByName(owner, name) {
const response = await this.fetch(`/projects/user/${owner}/${name}/metadata`);
return await response.json();
};

async startNetworkTrace(projectId) {
Expand Down

0 comments on commit 91e06dc

Please sign in to comment.