From 53e479d2dc7753bdf9739a0dbfa2e50ad5fb9153 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Fri, 11 Oct 2024 11:37:03 -0300 Subject: [PATCH] use primaryKey.tsType. (#1247) --- .blueprint/generate-sample/templates/samples/flickr2.jdl | 1 + .../templates/src/app/pages/entities/_entity.service.ts.ejs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.blueprint/generate-sample/templates/samples/flickr2.jdl b/.blueprint/generate-sample/templates/samples/flickr2.jdl index c73eb313a..04badc84c 100644 --- a/.blueprint/generate-sample/templates/samples/flickr2.jdl +++ b/.blueprint/generate-sample/templates/samples/flickr2.jdl @@ -16,6 +16,7 @@ entity Album { } entity Photo { + id UUID title String required description TextBlob image ImageBlob required diff --git a/generators/ionic/templates/src/app/pages/entities/_entity.service.ts.ejs b/generators/ionic/templates/src/app/pages/entities/_entity.service.ts.ejs index f35679c16..4c1e99e3a 100644 --- a/generators/ionic/templates/src/app/pages/entities/_entity.service.ts.ejs +++ b/generators/ionic/templates/src/app/pages/entities/_entity.service.ts.ejs @@ -49,7 +49,7 @@ export class <%= entityAngularName %>Service { return this.http.put(`${this.resourceUrl}/${<%= entityInstance %>.id}`, <%= entityInstance %>, { observe: 'response'}); } - find(id: <% if (primaryKey.type === 'String') { %>string<% } else { %>number<% } %>): Observable>> { + find(id: <%- primaryKey.tsType %>): Observable>> { return this.http.get(`${this.resourceUrl}/${id}`, { observe: 'response'}); } @@ -58,7 +58,7 @@ export class <%= entityAngularName %>Service { return this.http.get<<%= entityAngularName %>[]>(this.resourceUrl, { params: options, observe: 'response' }); } - delete(id: <% if (primaryKey.type === 'String') { %>string<% } else { %>number<% } %>): Observable> { + delete(id: <%- primaryKey.tsType %>): Observable> { return this.http.delete(`${this.resourceUrl}/${id}`, { observe: 'response'}); } }