Skip to content

Commit

Permalink
feat: add LOC status to public view.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdethier committed May 16, 2024
1 parent 864d37a commit 7b39b30
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions resources/schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,9 @@
},
"collectionParams": {
"$ref": "#/components/schemas/CollectionParamsView"
},
"status": {
"$ref": "#/components/schemas/LocRequestStatus"
}
},
"title": "LocPublicView",
Expand Down
1 change: 1 addition & 0 deletions src/logion/controllers/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ export interface components {
/** @description The LOC's template or undefined */
template?: string;
collectionParams?: components["schemas"]["CollectionParamsView"];
status?: components["schemas"]["LocRequestStatus"];
};
/**
* FetchLocRequestsSpecificationView
Expand Down
1 change: 1 addition & 0 deletions src/logion/controllers/locrequest.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ export class LocRequestController extends ApiController {
requesterAddress: this.locRequestAdapter.toSupportedAccountId(locDescription.requesterAddress),
ownerAddress: locDescription.ownerAddress.address,
createdOn: locDescription.createdOn || undefined,
status: request.status,
closedOn: request.closedOn || undefined,
files: request.getFiles().map(file => ({
hash: file.hash.toHex(),
Expand Down
1 change: 1 addition & 0 deletions test/unit/controllers/locrequest.controller.fetch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ async function _testGet(url: string, app: ReturnType<typeof setupApp>, expectedU
.expect('Content-Type', /application\/json/)
.then(response => {
expect(response.body.id).toBe(REQUEST_ID);
expect(response.body.status).toBeDefined();

const file = response.body.files[0]
const link = response.body.links[0]
Expand Down

0 comments on commit 7b39b30

Please sign in to comment.