@7365admin1/core 3.59.0 → 3.59.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @iservice365/core
2
2
 
3
+ ## 3.59.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 9daa1cb: Resident self-sign-up: drop file entries the app never managed to upload, instead of refusing the whole registration.
8
+
9
+ The registration wizard lists a document optimistically and patches in the `id` the upload returns. When the upload fails it keeps the entry, with no `id`, and sends it - so `schemaFiles.id.required()` returned 400 `"files[0].id" is required` for the entire sign-up, and the app only logged it. Residents saw a Submit button that did nothing.
10
+
11
+ The self-sign-up path now drops id-less entries before validating. Strictly widening: the authenticated staff path (`schemaPerson`) and `schemaFiles` itself are unchanged, an entry with an `id` is passed through untouched, and a body with no `files` key is unchanged.
12
+
3
13
  ## 3.59.0
4
14
 
5
15
  ### Minor Changes
package/dist/index.js CHANGED
@@ -58521,6 +58521,15 @@ function useGuestManagementController() {
58521
58521
  var import_joi71 = __toESM(require("joi"));
58522
58522
  var import_node_server_utils143 = require("@7365admin1/node-server-utils");
58523
58523
  var import_node_server_utils144 = require("@7365admin1/node-server-utils");
58524
+
58525
+ // src/utils/self-signup-files.util.ts
58526
+ function dropUnsentFiles(body) {
58527
+ if (!Array.isArray(body?.files))
58528
+ return body;
58529
+ return { ...body, files: body.files.filter((file) => file?.id) };
58530
+ }
58531
+
58532
+ // src/controllers/person.controller.ts
58524
58533
  function usePersonController() {
58525
58534
  const {
58526
58535
  getAll: _getAll,
@@ -58559,7 +58568,8 @@ function usePersonController() {
58559
58568
  return actor;
58560
58569
  }
58561
58570
  async function addResidentSelfSignUp(req, res, next) {
58562
- const { error, value } = schemaResidentSelfSignUp.validate(req.body, {
58571
+ const body = dropUnsentFiles(req.body);
58572
+ const { error, value } = schemaResidentSelfSignUp.validate(body, {
58563
58573
  abortEarly: false,
58564
58574
  stripUnknown: true
58565
58575
  });