Skip to content

Commit

Permalink
JNG-6004 fix missing export apis
Browse files Browse the repository at this point in the history
  • Loading branch information
noherczeg committed Nov 5, 2024
1 parent bd7a67e commit 48b49cf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,24 @@ private readonly {{ firstToLower imp }}StoredSerializer = {{ imp }}StoredSeriali
}
{{/ if }}

{{# if relation.isExportable }}
/**
* From: relation.isExportable
* @throws {AxiosError} With data containing {@link Array<FeedbackItem>} for status codes: 401, 403.
*/
async export{{ firstToUpper relation.name }}(owner?: {{ classDataName classType "Stored" }}, queryCustomizer?:{{ classDataName relation.target "QueryCustomizer" }}): Promise<any> {
const path = '{{ restPath (getRelationOwnerAsClassType relation) "/" relation.name "/~export" }}';
const response = await this.axios.post(this.getPathForActor(path), serialize{{ classDataName relation.target "QueryCustomizer" }}(queryCustomizer) ?? {}, {
responseType: 'blob',
headers: owner ? {
'X-Judo-SignedIdentifier': owner.__signedIdentifier
} : undefined,
});

return response;
}
{{/ if }}

{{# each relation.target.operationsOrderedByName as | operation | }}
/**
* @throws {AxiosError}{{# if (hasFaults operation) }}With data containing {@link{{ faultContainerName operation }} } for business related errors (status code is 422).{{/ if }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export interface {{ serviceClassName classType }} {
{{# if relation.isDeletable }}
delete{{ firstToUpper relation.name }}(target: {{ classDataName relation.target "Stored" }}): Promise<JudoRestResponse<void>>;
{{/ if }}
{{# if relation.isExportable }}
export{{ firstToUpper relation.name }}(owner?: {{ classDataName classType "Stored" }}, queryCustomizer?: {{ classDataName relation.target "QueryCustomizer" }}): Promise<any>;
{{/ if }}
{{# each relation.target.operationsOrderedByName as | operation | }}
{{ operation.name }}For{{ firstToUpper relation.name }}({{# if operation.isMapped }}owner: {{ classDataName relation.target "Stored" }}{{/ if }}{{# if operation.input }}{{# if operation.isMapped }}, {{/ if }}target: {{ classDataName operation.input.target "" }}{{/ if }}): Promise<JudoRestResponse<{{# if operation.output }}{{ classDataName operation.output.target "Stored" }}{{ else }}void{{/ if }}>>;
{{# if operation.input }}
Expand Down

0 comments on commit 48b49cf

Please sign in to comment.