umwd-components 0.1.706 → 0.1.708
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/dist/src/components/logistics/note/NoteTakingComponent.js +1 -1
- package/dist/src/data/actions/logistics/note/createNoteAction.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/logistics/note/NoteTakingComponent.tsx +7 -6
- package/src/data/actions/logistics/note/createNoteAction.ts +5 -5
package/package.json
CHANGED
|
@@ -55,13 +55,13 @@ export default function NoteTakingComponent({
|
|
|
55
55
|
if (formState?.message) {
|
|
56
56
|
handleAddMessage({
|
|
57
57
|
message: formState.message,
|
|
58
|
-
severity: formState.severity || "
|
|
58
|
+
severity: formState.severity || "error",
|
|
59
59
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
}
|
|
61
|
+
if (formState?.severity === "success") {
|
|
62
|
+
setOpen(false);
|
|
63
|
+
if (revalidateCallback) {
|
|
64
|
+
revalidateCallback();
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}, [formState]);
|
|
@@ -111,6 +111,7 @@ export default function NoteTakingComponent({
|
|
|
111
111
|
div: { color: "black" },
|
|
112
112
|
}}
|
|
113
113
|
textfieldProps={{
|
|
114
|
+
id: "content",
|
|
114
115
|
placeholder: "Write your note here...",
|
|
115
116
|
multiline: true,
|
|
116
117
|
minRows: 5,
|
|
@@ -7,8 +7,8 @@ import { flattenAttributes } from "../../../../lib/utils";
|
|
|
7
7
|
const schemaUpdate = z.object({
|
|
8
8
|
content: z
|
|
9
9
|
.string()
|
|
10
|
-
.min(10)
|
|
11
|
-
.max(5000,
|
|
10
|
+
.min(10, "Description must be at least 10 characters long")
|
|
11
|
+
.max(5000, "Description cannot be more than 5000 characters long"),
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
export async function createNoteAction(
|
|
@@ -25,9 +25,8 @@ export async function createNoteAction(
|
|
|
25
25
|
severity: "error",
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
|
|
29
28
|
const validatedFields = schemaUpdate.safeParse({
|
|
30
|
-
|
|
29
|
+
content: formData.get("content"),
|
|
31
30
|
});
|
|
32
31
|
|
|
33
32
|
if (!validatedFields.success) {
|
|
@@ -35,7 +34,8 @@ export async function createNoteAction(
|
|
|
35
34
|
...prevState,
|
|
36
35
|
zodErrors: validatedFields.error.flatten().fieldErrors,
|
|
37
36
|
strapiErrors: null,
|
|
38
|
-
message:
|
|
37
|
+
message: null,
|
|
38
|
+
severity: null,
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
|