Skip to content
This repository has been archived by the owner on Mar 21, 2021. It is now read-only.

Commit

Permalink
Return array from query function
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Whittington committed Mar 10, 2020
1 parent c434fac commit aeb83f8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default class <%= entityAngularName %>Service {
});
}

public query(queryParams?: any<% if (pagination !== 'no') { %>, paginationQuery?: any<% } %>) : Promise<I<%= entityAngularName %>> {
return new Promise<I<%= entityAngularName %>>((resolve, reject) => {
public query(queryParams?: any<% if (pagination !== 'no') { %>, paginationQuery?: any<% } %>) : Promise<I<%= entityAngularName %>[]> {
return new Promise<I<%= entityAngularName %>[]>((resolve, reject) => {
axios.get(`${baseApiUrl}?${buildQueryParams(queryParams)}`<% if (pagination !== 'no') { %> + `&${buildPaginationQueryOpts(paginationQuery)}` <% } %>).then(function (res) {
resolve(res.data);
}).catch(err => { reject(err); });
Expand Down

0 comments on commit aeb83f8

Please sign in to comment.