umwd-components 0.1.240 → 0.1.241

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.
@@ -122,7 +122,7 @@ function PageBuilder(_ref) {
122
122
  text: "save changes",
123
123
  loadingText: "loading"
124
124
  }), /*#__PURE__*/React.createElement(StrapiErrors.StrapiErrors, {
125
- error: formState.strapiErrors
125
+ error: formState === null || formState === void 0 ? void 0 : formState.strapiErrors
126
126
  })), /*#__PURE__*/React.createElement(material.Stack, {
127
127
  spacing: 2,
128
128
  sx: {
@@ -39,13 +39,14 @@ const schemaUpdate = zod.z.object({
39
39
  })
40
40
  ), */
41
41
  });
42
- async function updatePageAction(prevState, FormData) {
42
+ async function updatePageAction(prevState, formData) {
43
43
  const validatedFields = schemaUpdate.safeParse({
44
- id: FormData.get("id"),
45
- title: FormData.get("title"),
46
- description: FormData.get("description")
47
- // blocks: FormData.get("blocks"),
44
+ id: formData.get("id"),
45
+ title: formData.get("title"),
46
+ description: formData.get("description")
47
+ // blocks: formData.get("blocks"),
48
48
  });
49
+ console.log(validatedFields);
49
50
  if (!validatedFields.success) {
50
51
  return {
51
52
  ...prevState,
@@ -11,6 +11,7 @@ var utils = require('../../lib/utils.js');
11
11
  const baseUrl = utils.getStrapiURL();
12
12
  async function updatePageService(pageData) {
13
13
  const url = new URL("/api/pages/".concat(pageData.id), baseUrl);
14
+ console.log(url);
14
15
  try {
15
16
  const response = await fetch(url, {
16
17
  method: "POST",
@@ -118,7 +118,7 @@ function PageBuilder(_ref) {
118
118
  text: "save changes",
119
119
  loadingText: "loading"
120
120
  }), /*#__PURE__*/React__default.createElement(StrapiErrors, {
121
- error: formState.strapiErrors
121
+ error: formState === null || formState === void 0 ? void 0 : formState.strapiErrors
122
122
  })), /*#__PURE__*/React__default.createElement(Stack, {
123
123
  spacing: 2,
124
124
  sx: {
@@ -37,13 +37,14 @@ const schemaUpdate = z.object({
37
37
  })
38
38
  ), */
39
39
  });
40
- async function updatePageAction(prevState, FormData) {
40
+ async function updatePageAction(prevState, formData) {
41
41
  const validatedFields = schemaUpdate.safeParse({
42
- id: FormData.get("id"),
43
- title: FormData.get("title"),
44
- description: FormData.get("description")
45
- // blocks: FormData.get("blocks"),
42
+ id: formData.get("id"),
43
+ title: formData.get("title"),
44
+ description: formData.get("description")
45
+ // blocks: formData.get("blocks"),
46
46
  });
47
+ console.log(validatedFields);
47
48
  if (!validatedFields.success) {
48
49
  return {
49
50
  ...prevState,
@@ -9,6 +9,7 @@ import { getStrapiURL } from '../../lib/utils.js';
9
9
  const baseUrl = getStrapiURL();
10
10
  async function updatePageService(pageData) {
11
11
  const url = new URL("/api/pages/".concat(pageData.id), baseUrl);
12
+ console.log(url);
12
13
  try {
13
14
  const response = await fetch(url, {
14
15
  method: "POST",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umwd-components",
3
- "version": "0.1.240",
3
+ "version": "0.1.241",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -80,7 +80,7 @@ export default function PageBuilder({
80
80
  sx={{ backgroundColor: "primary.dark", px: 2, py: 1 }}
81
81
  >
82
82
  <SubmitButton text="save changes" loadingText="loading" />
83
- <StrapiErrors error={formState.strapiErrors} />
83
+ <StrapiErrors error={formState?.strapiErrors} />
84
84
  </Stack>
85
85
  <Stack spacing={2} sx={{ p: 2 }}>
86
86
  <TextField
@@ -35,14 +35,16 @@ const schemaUpdate = z.object({
35
35
  ), */
36
36
  });
37
37
 
38
- export async function updatePageAction(prevState: any, FormData: FormData) {
38
+ export async function updatePageAction(prevState: any, formData: FormData) {
39
39
  const validatedFields = schemaUpdate.safeParse({
40
- id: FormData.get("id"),
41
- title: FormData.get("title"),
42
- description: FormData.get("description"),
43
- // blocks: FormData.get("blocks"),
40
+ id: formData.get("id"),
41
+ title: formData.get("title"),
42
+ description: formData.get("description"),
43
+ // blocks: formData.get("blocks"),
44
44
  });
45
45
 
46
+ console.log(validatedFields);
47
+
46
48
  if (!validatedFields.success) {
47
49
  return {
48
50
  ...prevState,
@@ -12,6 +12,8 @@ const baseUrl = getStrapiURL();
12
12
  export async function updatePageService(pageData: pageDataProps) {
13
13
  const url = new URL(`/api/pages/${pageData.id}`, baseUrl);
14
14
 
15
+ console.log(url);
16
+
15
17
  try {
16
18
  const response = await fetch(url, {
17
19
  method: "POST",