Skip to content

Commit

Permalink
JNG-4838 update services
Browse files Browse the repository at this point in the history
  • Loading branch information
noherczeg committed Oct 10, 2023
1 parent 20b65a0 commit 4f9e3f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ export class {{ serviceRelationName relation }}Impl extends JudoAxiosService imp
* From: relation.isRefreshable
* @throws {AxiosError} With data containing {@link Array<FeedbackItem>} for status codes: 401, 403.
*/
async refresh(owner: JudoIdentifiable<{{ classDataName relation.target "" }}>, mask?: string): Promise<{{ classDataName relation.target "Stored" }}> {
async refresh(owner: JudoIdentifiable<{{ classDataName relation.target "" }}>, queryCustomizer?: {{ classDataName relation.target "QueryCustomizer" }}): Promise<{{ classDataName relation.target "Stored" }}> {
const path = '{{ restPath relation.target "/~get" }}';
const queryCustomizer: {{ classDataName relation.target "QueryCustomizer" }} | undefined = mask ? { _mask: mask } : undefined;
const response = await this.axios.post(this.getPathForActor(path), queryCustomizer ?? {}, {
headers: {
'X-Judo-SignedIdentifier': owner.__signedIdentifier,
Expand Down Expand Up @@ -233,9 +232,8 @@ export class {{ serviceRelationName relation }}Impl extends JudoAxiosService imp
return response.data;
}
{{ else }}
async get{{ firstToUpper targetRelation.name }}(owner: JudoIdentifiable<{{ classDataName relation.target "" }}>, mask?: string): Promise<{{ classDataName targetRelation.target "Stored" }}> {
async get{{ firstToUpper targetRelation.name }}(owner: JudoIdentifiable<{{ classDataName relation.target "" }}>, queryCustomizer?: {{ classDataName targetRelation.target "QueryCustomizer" }}): Promise<{{ classDataName targetRelation.target "Stored" }}> {
const path = '{{ restPath relation.target "/" targetRelation.name "/~get" }}';
const queryCustomizer: {{ classDataName relation.target "QueryCustomizer" }} | undefined = mask ? { _mask: mask } : undefined;
const response = await this.axios.post(this.getPathForActor(path), queryCustomizer ?? {}, {
headers: {
'X-Judo-SignedIdentifier': owner.__signedIdentifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface {{ serviceRelationName relation }} {
{{/ if }}

{{# if relation.isRefreshable }}
refresh(owner: JudoIdentifiable<{{ classDataName relation.target "" }}>, mask?: string): Promise<{{ classDataName relation.target "Stored" }}>;
refresh(owner: JudoIdentifiable<{{ classDataName relation.target "" }}>, queryCustomizer?: {{ classDataName relation.target "QueryCustomizer" }}): Promise<{{ classDataName relation.target "Stored" }}>;
{{/ if }}

{{# if relation.isRangeable }}
Expand Down Expand Up @@ -60,7 +60,7 @@ export interface {{ serviceRelationName relation }} {
{{# if targetRelation.isCollection }}
list{{ firstToUpper targetRelation.name }}(owner: JudoIdentifiable<{{ classDataName relation.target "" }}>, queryCustomizer?: {{ classDataName targetRelation.target "QueryCustomizer" }}): Promise<Array<{{ classDataName targetRelation.target "Stored" }}>>;
{{ else }}
get{{ firstToUpper targetRelation.name }}(owner: JudoIdentifiable<{{ classDataName relation.target "" }}>, mask?: string): Promise<{{ classDataName targetRelation.target "Stored" }}>;
get{{ firstToUpper targetRelation.name }}(owner: JudoIdentifiable<{{ classDataName relation.target "" }}>, queryCustomizer?: {{ classDataName targetRelation.target "QueryCustomizer" }}): Promise<{{ classDataName targetRelation.target "Stored" }}>;
{{/ if }}
{{/ if }}

Expand Down

0 comments on commit 4f9e3f4

Please sign in to comment.