Skip to content

Commit

Permalink
feat: request organization from api
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarlorentzon committed Sep 6, 2022
1 parent 486d5b2 commit 5017e60
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/provider/GraphConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class GraphConverter {

source.cluster = source.sfm_cluster ?? { id: null, url: null };
source.creator = { id: null, username: null };
source.owner = source.owner ?? { id: null };
source.owner = source.organization ?? { id: null };
source.mesh = source.mesh ?? { id: null, url: null };

return source;
Expand Down
1 change: 1 addition & 0 deletions src/api/provider/GraphEnts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface GraphCoreImageEnt extends IDEnt {

export interface GraphSpatialImageEnt extends SpatialImageEnt {
merge_cc: number;
organization: IDEnt;
sfm_cluster: URLEnt;
thumb_1024_url: string;
thumb_2048_url: string;
Expand Down
1 change: 1 addition & 0 deletions src/api/provider/GraphQueryCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class GraphQueryCreator {
'height',
'merge_cc',
'mesh',
'organization',
'quality_score',
'sfm_cluster',
'thumb_1024_url',
Expand Down
6 changes: 4 additions & 2 deletions test/api/provider/GraphConverter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ describe("GraphConverter.spatialImage", () => {
id: 'image-id',
merge_cc: 7,
mesh: { id: 'mesh-id', url: 'mesh-url' },
owner: { id: 'owner-id' },
organization: { id: 'owner-id' },
owner: null,
quality_score: 0.8,
sfm_cluster: { id: 'cluster-id', url: 'cluster-url' },
thumb: null,
Expand Down Expand Up @@ -180,7 +181,7 @@ describe("GraphConverter.spatialImage", () => {
expect(image.id).toBe(ent.id);
expect(image.merge_id).toBe(ent.merge_cc.toString());
expect(image.mesh.url).toBe(ent.mesh.url);
expect(image.owner.id).toBe(ent.owner.id);
expect(image.owner.id).toBe(ent.organization.id);
expect(image.quality_score).toBe(ent.quality_score);
expect(image.thumb.url).toBe(ent.thumb_1024_url);
expect(image.width).toBe(ent.width);
Expand All @@ -205,6 +206,7 @@ describe("GraphConverter.spatialImage", () => {
id: 'image-id',
merge_cc: 7,
mesh: null,
organization: null,
owner: null,
quality_score: 0.8,
sfm_cluster: null,
Expand Down

0 comments on commit 5017e60

Please sign in to comment.