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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umwd-components",
3
- "version": "0.1.706",
3
+ "version": "0.1.708",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/src/index.js",
6
6
  "module": "dist/src/index.js",
@@ -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 || "success",
58
+ severity: formState.severity || "error",
59
59
  });
60
- if (formState?.severity === "success") {
61
- setOpen(false);
62
- if (revalidateCallback) {
63
- revalidateCallback();
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, { message: "Description must be at least 10 characters" }),
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
- id: formData.get("content"),
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: "Missing Fields. Failed to Update Page.",
37
+ message: null,
38
+ severity: null,
39
39
  };
40
40
  }
41
41