Skip to content

Commit 65e6132

Browse files
committed
Fixed a bug with refreshing patched models
1 parent 267ae0c commit 65e6132

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/main/java/org/computate/frFR/java/EcrireApiClasse.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2909,15 +2909,15 @@ else if(classeApiMethode.equals(i18nGlobale.getString(I18n.var_PUTFusion)) || cl
29092909
tl(7, "JsonObject jsonObject = JsonObject.mapFrom(o);");
29102910
tl(7, "o2 = jsonObject.mapTo(", classeNomSimple, ".class);");
29112911
tl(7, "o2.set", i18nGlobale.getString(I18n.var_RequeteSite), "_(", i18nGlobale.getString(I18n.var_requeteSite), ");");
2912+
tl(7, classeApiOperationIdMethode, "Future(o2, false).onSuccess(o3 -> {");
2913+
tl(8, i18nGlobale.getString(I18n.var_gestionnaireEvenements), ".handle(Future.succeededFuture(ServiceResponse.completedWithJson(Buffer.buffer(new JsonObject().encodePrettily()))));");
2914+
tl(7, "}).onFailure(ex -> {");
2915+
tl(8, i18nGlobale.getString(I18n.var_gestionnaireEvenements), ".handle(Future.failedFuture(ex));");
2916+
tl(7, "});");
29122917
tl(6, "} else {");
2913-
tl(7, "o2 = body.mapTo(", classeNomSimple, ".class);");
2914-
tl(7, "o2.set", i18nGlobale.getString(I18n.var_RequeteSite), "_(", i18nGlobale.getString(I18n.var_requeteSite), ");");
2918+
tl(7, "String m = String.format(\"", i18nGlobale.getString(I18n.str_s_s_non_trouve), "\", \"", classeNomAdjectifSingulier, "\", null);");
2919+
tl(7, i18nGlobale.getString(I18n.var_gestionnaireEvenements), ".handle(Future.failedFuture(m));");
29152920
tl(6, "}");
2916-
tl(6, classeApiOperationIdMethode, "Future(o2, false).onSuccess(o3 -> {");
2917-
tl(7, i18nGlobale.getString(I18n.var_gestionnaireEvenements), ".handle(Future.succeededFuture(ServiceResponse.completedWithJson(Buffer.buffer(new JsonObject().encodePrettily()))));");
2918-
tl(6, "}).onFailure(ex -> {");
2919-
tl(7, i18nGlobale.getString(I18n.var_gestionnaireEvenements), ".handle(Future.failedFuture(ex));");
2920-
tl(6, "});");
29212921
tl(5, "} catch(Exception ex) {");
29222922
tl(6, "LOG.error(String.format(\"", classeApiOperationIdMethode, " ", i18nGlobale.getString(I18n.str_a_échoué), ". \"), ex);");
29232923
tl(6, i18nGlobale.getString(I18n.var_erreur), "(", i18nGlobale.getString(I18n.var_requeteSite), ", ", i18nGlobale.getString(I18n.var_gestionnaireEvenements), ", ex);");
@@ -5030,6 +5030,7 @@ public void ecrireGenApiServiceImpl4(String classeLangueNom) throws Exception {
50305030
tl(5, "params.put(\"header\", ", i18nGlobale.getString(I18n.var_requeteSite), ".get", i18nGlobale.getString(I18n.var_RequeteService), "().getParams().getJsonObject(\"header\"));");
50315031
tl(5, "params.put(\"form\", new JsonObject());");
50325032
tl(5, "params.put(\"path\", new JsonObject());");
5033+
tl(5, "params.put(\"scopes\", new JsonArray().add(\"GET\").add(\"PATCH\"));");
50335034
tl(5, "JsonObject query = new JsonObject();");
50345035
tl(5, "Boolean softCommit = Optional.ofNullable(", i18nGlobale.getString(I18n.var_requeteSite), ".get", i18nGlobale.getString(I18n.var_RequeteService), "().getParams()).map(p -> p.getJsonObject(\"query\")).map( q -> q.getBoolean(\"softCommit\")).orElse(null);");
50355036
tl(5, "Integer commitWithin = Optional.ofNullable(", i18nGlobale.getString(I18n.var_requeteSite), ".get", i18nGlobale.getString(I18n.var_RequeteService), "().getParams()).map(p -> p.getJsonObject(\"query\")).map( q -> q.getInteger(\"commitWithin\")).orElse(null);");

0 commit comments

Comments
 (0)