@carlonicora/nextjs-jsonapi 3.0.0 → 3.0.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.
@@ -8025,7 +8025,12 @@ function UserEditorInternal({
8025
8025
  }, [file, company]);
8026
8026
  const formSchema = useMemo10(
8027
8027
  () => z.object({
8028
- id: z.uuidv4(),
8028
+ // Any UUID version: on edit this is the PERSISTED id, and seeded/legacy
8029
+ // users can carry a non-v4 uuid (the migration-created Administrator is
8030
+ // v1). `z.uuidv4()` rejected those, and because `id` has no rendered
8031
+ // field the failure was invisible — handleSubmit simply never fired.
8032
+ // New users still get a v4 from `v4()` in getDefaultValues.
8033
+ id: z.uuid(),
8029
8034
  name: z.string().min(1, { message: t(`user.fields.name.error`) }),
8030
8035
  email: z.string().min(1, { message: t(`common.fields.email.error`) }),
8031
8036
  password: z.string().optional(),
@@ -8110,7 +8115,11 @@ function UserEditorInternal({
8110
8115
  avatar: resetImage ? void 0 : values.avatar,
8111
8116
  roleIds: values.roleIds,
8112
8117
  sendInvitationEmail: values.sendInvitationEmail,
8113
- companyId: company.id,
8118
+ // Optional: `companyId` only sets the `x-companyid` header, and a user
8119
+ // can legitimately have no company (the seeded Administrator does), in
8120
+ // which case `company` is null here. `company!.id` threw a TypeError
8121
+ // and surfaced as a generic "update failed" toast.
8122
+ companyId: company?.id,
8114
8123
  adminCreated
8115
8124
  };
8116
8125
  const updatedUser = user ? await UserService.update(payload) : await UserService.create(payload);
@@ -10212,7 +10221,7 @@ import { useRef as useRef17 } from "react";
10212
10221
  import dynamic from "next/dynamic";
10213
10222
  import React17 from "react";
10214
10223
  import { jsx as jsx88 } from "react/jsx-runtime";
10215
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-VVAY73V2.mjs"), {
10224
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-G4XNDV2O.mjs"), {
10216
10225
  ssr: false
10217
10226
  });
10218
10227
  var BlockNoteEditorContainer = React17.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -24768,4 +24777,4 @@ export {
24768
24777
  useOAuthClients,
24769
24778
  useOAuthClient
24770
24779
  };
24771
- //# sourceMappingURL=chunk-J54546YC.mjs.map
24780
+ //# sourceMappingURL=chunk-WCX4CLRJ.mjs.map