@instockng/storefront-ui 1.0.2 → 1.0.4

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.
Files changed (112) hide show
  1. package/dist/index.mjs +18 -17
  2. package/dist/index10.mjs +1 -0
  3. package/dist/index100.mjs +1 -0
  4. package/dist/index101.mjs +1 -0
  5. package/dist/index102.mjs +1 -0
  6. package/dist/index103.mjs +1 -0
  7. package/dist/index104.mjs +1 -0
  8. package/dist/index105.mjs +1 -0
  9. package/dist/index106.mjs +1 -0
  10. package/dist/index107.mjs +1 -0
  11. package/dist/index108.mjs +1 -0
  12. package/dist/index109.mjs +1 -0
  13. package/dist/index11.mjs +1 -0
  14. package/dist/index110.mjs +1 -0
  15. package/dist/index111.mjs +1 -0
  16. package/dist/index12.mjs +1 -0
  17. package/dist/index13.mjs +1 -0
  18. package/dist/index14.mjs +1 -0
  19. package/dist/index15.mjs +1 -0
  20. package/dist/index16.mjs +1 -0
  21. package/dist/index17.mjs +1 -0
  22. package/dist/index18.mjs +1 -0
  23. package/dist/index19.mjs +1 -0
  24. package/dist/index2.mjs +1 -0
  25. package/dist/index20.mjs +3 -2
  26. package/dist/index21.mjs +2 -1
  27. package/dist/index22.mjs +1 -0
  28. package/dist/index23.mjs +1 -0
  29. package/dist/index24.mjs +1 -0
  30. package/dist/index25.mjs +1 -0
  31. package/dist/index26.mjs +1 -0
  32. package/dist/index27.mjs +1 -0
  33. package/dist/index28.mjs +12 -11
  34. package/dist/index29.mjs +2 -1
  35. package/dist/index3.mjs +1 -0
  36. package/dist/index30.mjs +2 -1
  37. package/dist/index31.mjs +2 -1
  38. package/dist/index32.mjs +2 -1
  39. package/dist/index33.mjs +1 -0
  40. package/dist/index34.mjs +1 -0
  41. package/dist/index35.mjs +1 -0
  42. package/dist/index36.mjs +1 -0
  43. package/dist/index37.mjs +2 -1
  44. package/dist/index38.mjs +1 -0
  45. package/dist/index39.mjs +1 -0
  46. package/dist/index4.mjs +1 -0
  47. package/dist/index40.mjs +1 -0
  48. package/dist/index41.mjs +37 -23
  49. package/dist/index42.mjs +45 -36
  50. package/dist/index43.mjs +100 -44
  51. package/dist/index44.mjs +113 -99
  52. package/dist/index45.mjs +45 -80
  53. package/dist/index46.mjs +65 -53
  54. package/dist/index47.mjs +67 -49
  55. package/dist/index48.mjs +55 -73
  56. package/dist/index49.mjs +53 -63
  57. package/dist/index5.mjs +1 -0
  58. package/dist/index50.mjs +15 -70
  59. package/dist/index51.mjs +14 -14
  60. package/dist/index52.mjs +59 -13
  61. package/dist/index53.mjs +102 -34
  62. package/dist/index54.mjs +100 -95
  63. package/dist/index55.mjs +23 -132
  64. package/dist/index56.mjs +1 -0
  65. package/dist/index57.mjs +1 -0
  66. package/dist/index58.mjs +3 -2
  67. package/dist/index59.mjs +5 -3
  68. package/dist/index6.mjs +1 -0
  69. package/dist/index60.mjs +5 -2
  70. package/dist/index61.mjs +3 -5
  71. package/dist/index62.mjs +1 -0
  72. package/dist/index63.mjs +1 -0
  73. package/dist/index64.mjs +1 -0
  74. package/dist/index65.mjs +1 -0
  75. package/dist/index66.mjs +1 -0
  76. package/dist/index67.mjs +1 -0
  77. package/dist/index68.mjs +1 -0
  78. package/dist/index69.mjs +1 -0
  79. package/dist/index7.mjs +1 -0
  80. package/dist/index70.mjs +1 -0
  81. package/dist/index71.mjs +1 -0
  82. package/dist/index72.mjs +1 -0
  83. package/dist/index73.mjs +1 -0
  84. package/dist/index74.mjs +1 -0
  85. package/dist/index75.mjs +1 -0
  86. package/dist/index76.mjs +1 -0
  87. package/dist/index77.mjs +1 -0
  88. package/dist/index78.mjs +1 -0
  89. package/dist/index79.mjs +1 -0
  90. package/dist/index8.mjs +1 -0
  91. package/dist/index80.mjs +1 -0
  92. package/dist/index81.mjs +1 -0
  93. package/dist/index82.mjs +1 -0
  94. package/dist/index83.mjs +1 -0
  95. package/dist/index84.mjs +1 -0
  96. package/dist/index85.mjs +1 -0
  97. package/dist/index86.mjs +1 -0
  98. package/dist/index87.mjs +1 -0
  99. package/dist/index88.mjs +1 -0
  100. package/dist/index89.mjs +1 -0
  101. package/dist/index9.mjs +1 -0
  102. package/dist/index90.mjs +1 -0
  103. package/dist/index91.mjs +1 -0
  104. package/dist/index92.mjs +1 -0
  105. package/dist/index93.mjs +1 -0
  106. package/dist/index94.mjs +1 -0
  107. package/dist/index95.mjs +1 -0
  108. package/dist/index96.mjs +1 -0
  109. package/dist/index97.mjs +1 -0
  110. package/dist/index98.mjs +1 -0
  111. package/dist/index99.mjs +1 -0
  112. package/package.json +1 -1
package/dist/index43.mjs CHANGED
@@ -1,46 +1,102 @@
1
- import a from "./index64.mjs";
2
- import p from "./index65.mjs";
3
- import m from "./index66.mjs";
4
- import i from "./index67.mjs";
5
- import f from "./index68.mjs";
6
- import l from "./index69.mjs";
7
- import c from "./index70.mjs";
8
- import d from "./index71.mjs";
9
- import u from "./index72.mjs";
10
- import { VERSION as x } from "./index73.mjs";
11
- import C from "./index74.mjs";
12
- import A from "./index75.mjs";
13
- import E from "./index76.mjs";
14
- import O from "./index77.mjs";
15
- import S from "./index78.mjs";
16
- import H from "./index79.mjs";
17
- import T from "./index80.mjs";
18
- function n(o) {
19
- const t = new m(o), e = p(m.prototype.request, t);
20
- return a.extend(e, m.prototype, t, { allOwnKeys: !0 }), a.extend(e, t, null, { allOwnKeys: !0 }), e.create = function(s) {
21
- return n(i(o, s));
22
- }, e;
23
- }
24
- const r = n(f);
25
- r.Axios = m;
26
- r.CanceledError = c;
27
- r.CancelToken = d;
28
- r.isCancel = u;
29
- r.VERSION = x;
30
- r.toFormData = C;
31
- r.AxiosError = A;
32
- r.Cancel = r.CanceledError;
33
- r.all = function(t) {
34
- return Promise.all(t);
35
- };
36
- r.spread = E;
37
- r.isAxiosError = O;
38
- r.mergeConfig = i;
39
- r.AxiosHeaders = S;
40
- r.formToJSON = (o) => l(a.isHTMLForm(o) ? new FormData(o) : o);
41
- r.getAdapter = H.getAdapter;
42
- r.HttpStatusCode = T;
43
- r.default = r;
1
+ 'use client';
2
+ var p = Object.defineProperty;
3
+ var k = (r, e, i) => e in r ? p(r, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[e] = i;
4
+ var h = (r, e, i) => k(r, typeof e != "symbol" ? e + "" : e, i);
5
+ import { serialize as j } from "./index62.mjs";
6
+ import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./index63.mjs";
7
+ var v = (r, e) => new Proxy(() => {
8
+ }, {
9
+ get(t, s) {
10
+ if (!(typeof s != "string" || s === "then"))
11
+ return v(r, [...e, s]);
12
+ },
13
+ apply(t, s, a) {
14
+ return r({
15
+ path: e,
16
+ args: a
17
+ });
18
+ }
19
+ }), T = class {
20
+ constructor(r, e) {
21
+ h(this, "url");
22
+ h(this, "method");
23
+ h(this, "queryParams");
24
+ h(this, "pathParams", {});
25
+ h(this, "rBody");
26
+ h(this, "cType");
27
+ h(this, "fetch", async (r, e) => {
28
+ if (r) {
29
+ if (r.query && (this.queryParams = S(r.query)), r.form) {
30
+ const o = new FormData();
31
+ for (const [c, f] of Object.entries(r.form))
32
+ if (Array.isArray(f))
33
+ for (const l of f)
34
+ o.append(c, l);
35
+ else
36
+ o.append(c, f);
37
+ this.rBody = o;
38
+ }
39
+ r.json && (this.rBody = JSON.stringify(r.json), this.cType = "application/json"), r.param && (this.pathParams = r.param);
40
+ }
41
+ let i = this.method.toUpperCase();
42
+ const t = {
43
+ ...r == null ? void 0 : r.header,
44
+ ...typeof (e == null ? void 0 : e.headers) == "function" ? await e.headers() : e == null ? void 0 : e.headers
45
+ };
46
+ if (r != null && r.cookie) {
47
+ const o = [];
48
+ for (const [c, f] of Object.entries(r.cookie))
49
+ o.push(j(c, f, { path: "/" }));
50
+ t.Cookie = o.join(",");
51
+ }
52
+ this.cType && (t["Content-Type"] = this.cType);
53
+ const s = new Headers(t ?? void 0);
54
+ let a = this.url;
55
+ a = w(a), a = P(a, this.pathParams), this.queryParams && (a = a + "?" + this.queryParams.toString()), i = this.method.toUpperCase();
56
+ const u = !(i === "GET" || i === "HEAD");
57
+ return ((e == null ? void 0 : e.fetch) || fetch)(a, {
58
+ body: u ? this.rBody : void 0,
59
+ method: i,
60
+ headers: s,
61
+ ...e == null ? void 0 : e.init
62
+ });
63
+ });
64
+ this.url = r, this.method = e;
65
+ }
66
+ }, E = (r, e) => v(function i(t) {
67
+ var l;
68
+ const s = [...t.path], a = s.slice(-3).reverse();
69
+ if (a[0] === "toString")
70
+ return a[1] === "name" ? a[2] || "" : i.toString();
71
+ if (a[0] === "valueOf")
72
+ return a[1] === "name" ? a[2] || "" : i;
73
+ let u = "";
74
+ if (/^\$/.test(a[0])) {
75
+ const n = s.pop();
76
+ n && (u = n.replace(/^\$/, ""));
77
+ }
78
+ const o = s.join("/"), c = U(r, o);
79
+ if (u === "url") {
80
+ let n = c;
81
+ return t.args[0] && (t.args[0].param && (n = P(c, t.args[0].param)), t.args[0].query && (n = n + "?" + S(t.args[0].query).toString())), n = w(n), new URL(n);
82
+ }
83
+ if (u === "ws") {
84
+ const n = x(
85
+ t.args[0] && t.args[0].param ? P(c, t.args[0].param) : c,
86
+ "ws"
87
+ ), y = new URL(n), b = (l = t.args[0]) == null ? void 0 : l.query;
88
+ return b && Object.entries(b).forEach(([m, d]) => {
89
+ Array.isArray(d) ? d.forEach((q) => y.searchParams.append(m, q)) : y.searchParams.set(m, d);
90
+ }), ((...m) => (e == null ? void 0 : e.webSocket) !== void 0 && typeof e.webSocket == "function" ? e.webSocket(...m) : new WebSocket(...m))(y.toString());
91
+ }
92
+ const f = new T(c, u);
93
+ if (u) {
94
+ e ?? (e = {});
95
+ const n = C(e, { ...t.args[1] });
96
+ return f.fetch(t.args[0], n);
97
+ }
98
+ return f;
99
+ }, []);
44
100
  export {
45
- r as default
101
+ E as hc
46
102
  };
package/dist/index44.mjs CHANGED
@@ -1,101 +1,115 @@
1
- var p = Object.defineProperty;
2
- var k = (r, e, i) => e in r ? p(r, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[e] = i;
3
- var h = (r, e, i) => k(r, typeof e != "symbol" ? e + "" : e, i);
4
- import { serialize as j } from "./index62.mjs";
5
- import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./index63.mjs";
6
- var v = (r, e) => new Proxy(() => {
7
- }, {
8
- get(t, s) {
9
- if (!(typeof s != "string" || s === "then"))
10
- return v(r, [...e, s]);
11
- },
12
- apply(t, s, a) {
13
- return r({
14
- path: e,
15
- args: a
16
- });
17
- }
18
- }), T = class {
19
- constructor(r, e) {
20
- h(this, "url");
21
- h(this, "method");
22
- h(this, "queryParams");
23
- h(this, "pathParams", {});
24
- h(this, "rBody");
25
- h(this, "cType");
26
- h(this, "fetch", async (r, e) => {
27
- if (r) {
28
- if (r.query && (this.queryParams = S(r.query)), r.form) {
29
- const o = new FormData();
30
- for (const [c, f] of Object.entries(r.form))
31
- if (Array.isArray(f))
32
- for (const l of f)
33
- o.append(c, l);
34
- else
35
- o.append(c, f);
36
- this.rBody = o;
37
- }
38
- r.json && (this.rBody = JSON.stringify(r.json), this.cType = "application/json"), r.param && (this.pathParams = r.param);
39
- }
40
- let i = this.method.toUpperCase();
41
- const t = {
42
- ...r == null ? void 0 : r.header,
43
- ...typeof (e == null ? void 0 : e.headers) == "function" ? await e.headers() : e == null ? void 0 : e.headers
44
- };
45
- if (r != null && r.cookie) {
46
- const o = [];
47
- for (const [c, f] of Object.entries(r.cookie))
48
- o.push(j(c, f, { path: "/" }));
49
- t.Cookie = o.join(",");
50
- }
51
- this.cType && (t["Content-Type"] = this.cType);
52
- const s = new Headers(t ?? void 0);
53
- let a = this.url;
54
- a = w(a), a = P(a, this.pathParams), this.queryParams && (a = a + "?" + this.queryParams.toString()), i = this.method.toUpperCase();
55
- const u = !(i === "GET" || i === "HEAD");
56
- return ((e == null ? void 0 : e.fetch) || fetch)(a, {
57
- body: u ? this.rBody : void 0,
58
- method: i,
59
- headers: s,
60
- ...e == null ? void 0 : e.init
61
- });
62
- });
63
- this.url = r, this.method = e;
64
- }
65
- }, E = (r, e) => v(function i(t) {
66
- var l;
67
- const s = [...t.path], a = s.slice(-3).reverse();
68
- if (a[0] === "toString")
69
- return a[1] === "name" ? a[2] || "" : i.toString();
70
- if (a[0] === "valueOf")
71
- return a[1] === "name" ? a[2] || "" : i;
72
- let u = "";
73
- if (/^\$/.test(a[0])) {
74
- const n = s.pop();
75
- n && (u = n.replace(/^\$/, ""));
76
- }
77
- const o = s.join("/"), c = U(r, o);
78
- if (u === "url") {
79
- let n = c;
80
- return t.args[0] && (t.args[0].param && (n = P(c, t.args[0].param)), t.args[0].query && (n = n + "?" + S(t.args[0].query).toString())), n = w(n), new URL(n);
81
- }
82
- if (u === "ws") {
83
- const n = x(
84
- t.args[0] && t.args[0].param ? P(c, t.args[0].param) : c,
85
- "ws"
86
- ), y = new URL(n), b = (l = t.args[0]) == null ? void 0 : l.query;
87
- return b && Object.entries(b).forEach(([m, d]) => {
88
- Array.isArray(d) ? d.forEach((q) => y.searchParams.append(m, q)) : y.searchParams.set(m, d);
89
- }), ((...m) => (e == null ? void 0 : e.webSocket) !== void 0 && typeof e.webSocket == "function" ? e.webSocket(...m) : new WebSocket(...m))(y.toString());
90
- }
91
- const f = new T(c, u);
92
- if (u) {
93
- e ?? (e = {});
94
- const n = C(e, { ...t.args[1] });
95
- return f.fetch(t.args[0], n);
96
- }
97
- return f;
98
- }, []);
1
+ 'use client';
2
+ import { useQueryClient as y, useMutation as m } from "@tanstack/react-query";
3
+ import { useQueryUnwrapped as p } from "./index59.mjs";
4
+ import { createAdminRpcClients as d, authHeaders as c } from "./index21.mjs";
5
+ import { queryKeys as i } from "./index26.mjs";
6
+ import { useApiConfig as l } from "./index19.mjs";
7
+ function F(e) {
8
+ const { baseURL: r, authToken: n } = l();
9
+ return p({
10
+ queryKey: i.admin.orders.list(),
11
+ queryFn: async () => {
12
+ const t = await d(r).orders.index.$get({}, c(n));
13
+ if (!t.ok)
14
+ throw new Error(`Failed to fetch orders: ${t.statusText}`);
15
+ return t.json();
16
+ },
17
+ ...e
18
+ });
19
+ }
20
+ function T(e, r) {
21
+ const { baseURL: n, authToken: s } = l();
22
+ return p({
23
+ queryKey: i.admin.orders.detail(e),
24
+ queryFn: async () => {
25
+ const o = await d(n).orders[":id"].$get(
26
+ { param: { id: e } },
27
+ c(s)
28
+ );
29
+ if (!o.ok)
30
+ throw new Error(`Failed to fetch order: ${o.statusText}`);
31
+ return o.json();
32
+ },
33
+ ...r
34
+ });
35
+ }
36
+ function $(e) {
37
+ const { baseURL: r, authToken: n } = l(), s = y();
38
+ return m({
39
+ mutationFn: async (t) => {
40
+ const a = await d(r).orders.index.$post(
41
+ { json: t },
42
+ c(n)
43
+ );
44
+ if (!a.ok)
45
+ throw new Error(`Failed to create order: ${a.statusText}`);
46
+ return a.json();
47
+ },
48
+ onSuccess: () => {
49
+ s.invalidateQueries({ queryKey: i.admin.orders.all });
50
+ },
51
+ ...e
52
+ });
53
+ }
54
+ function j(e, r) {
55
+ const { baseURL: n, authToken: s } = l(), t = y();
56
+ return m({
57
+ mutationFn: async (o) => {
58
+ const u = await d(n).orders[":id"].$patch(
59
+ { param: { id: e }, json: o },
60
+ c(s)
61
+ );
62
+ if (!u.ok)
63
+ throw new Error(`Failed to update order: ${u.statusText}`);
64
+ return u.json();
65
+ },
66
+ onSuccess: () => {
67
+ t.invalidateQueries({ queryKey: i.admin.orders.detail(e) }), t.invalidateQueries({ queryKey: i.admin.orders.all });
68
+ },
69
+ ...r
70
+ });
71
+ }
72
+ function x(e, r) {
73
+ const { baseURL: n, authToken: s } = l(), t = y();
74
+ return m({
75
+ mutationFn: async (o) => {
76
+ const u = await d(n).orders[":id"].status.$patch(
77
+ { param: { id: e }, json: o },
78
+ c(s)
79
+ );
80
+ if (!u.ok)
81
+ throw new Error(`Failed to update order status: ${u.statusText}`);
82
+ return u.json();
83
+ },
84
+ onSuccess: () => {
85
+ t.invalidateQueries({ queryKey: i.admin.orders.detail(e) }), t.invalidateQueries({ queryKey: i.admin.orders.all });
86
+ },
87
+ ...r
88
+ });
89
+ }
90
+ function K(e, r) {
91
+ const { baseURL: n, authToken: s } = l(), t = y();
92
+ return m({
93
+ mutationFn: async () => {
94
+ const a = await d(n).orders[":id"].$delete(
95
+ { param: { id: e } },
96
+ c(s)
97
+ );
98
+ if (!a.ok)
99
+ throw new Error(`Failed to delete order: ${a.statusText}`);
100
+ return a.json();
101
+ },
102
+ onSuccess: () => {
103
+ t.invalidateQueries({ queryKey: i.admin.orders.all });
104
+ },
105
+ ...r
106
+ });
107
+ }
99
108
  export {
100
- E as hc
109
+ $ as useCreateOrder,
110
+ K as useDeleteOrder,
111
+ T as useGetOrder,
112
+ F as useListOrders,
113
+ j as useUpdateOrder,
114
+ x as useUpdateOrderStatus
101
115
  };
package/dist/index45.mjs CHANGED
@@ -1,114 +1,79 @@
1
+ 'use client';
1
2
  import { useQueryClient as y, useMutation as m } from "@tanstack/react-query";
2
- import { useQueryUnwrapped as p } from "./index61.mjs";
3
- import { createAdminRpcClients as d, authHeaders as c } from "./index21.mjs";
4
- import { queryKeys as i } from "./index26.mjs";
5
- import { useApiConfig as l } from "./index19.mjs";
6
- function F(e) {
7
- const { baseURL: r, authToken: n } = l();
8
- return p({
9
- queryKey: i.admin.orders.list(),
3
+ import { useQueryUnwrapped as b } from "./index59.mjs";
4
+ import { createAdminRpcClients as u, authHeaders as c } from "./index21.mjs";
5
+ import { queryKeys as o } from "./index26.mjs";
6
+ import { useApiConfig as d } from "./index19.mjs";
7
+ function k(e) {
8
+ const { baseURL: t, authToken: r } = d();
9
+ return b({
10
+ queryKey: o.admin.brands.list(),
10
11
  queryFn: async () => {
11
- const t = await d(r).orders.index.$get({}, c(n));
12
- if (!t.ok)
13
- throw new Error(`Failed to fetch orders: ${t.statusText}`);
14
- return t.json();
12
+ const n = await u(t).brands.index.$get({}, c(r));
13
+ if (!n.ok) throw new Error(`Failed to fetch brands: ${n.statusText}`);
14
+ return n.json();
15
15
  },
16
16
  ...e
17
17
  });
18
18
  }
19
- function T(e, r) {
20
- const { baseURL: n, authToken: s } = l();
21
- return p({
22
- queryKey: i.admin.orders.detail(e),
19
+ function F(e, t) {
20
+ const { baseURL: r, authToken: s } = d();
21
+ return b({
22
+ queryKey: o.admin.brands.detail(e),
23
23
  queryFn: async () => {
24
- const o = await d(n).orders[":id"].$get(
25
- { param: { id: e } },
26
- c(s)
27
- );
28
- if (!o.ok)
29
- throw new Error(`Failed to fetch order: ${o.statusText}`);
30
- return o.json();
24
+ const i = await u(r).brands[":id"].$get({ param: { id: e } }, c(s));
25
+ if (!i.ok) throw new Error(`Failed to fetch brand: ${i.statusText}`);
26
+ return i.json();
31
27
  },
32
- ...r
28
+ ...t
33
29
  });
34
30
  }
35
- function $(e) {
36
- const { baseURL: r, authToken: n } = l(), s = y();
31
+ function T(e) {
32
+ const { baseURL: t, authToken: r } = d(), s = y();
37
33
  return m({
38
- mutationFn: async (t) => {
39
- const a = await d(r).orders.index.$post(
40
- { json: t },
41
- c(n)
42
- );
43
- if (!a.ok)
44
- throw new Error(`Failed to create order: ${a.statusText}`);
34
+ mutationFn: async (n) => {
35
+ const a = await u(t).brands.index.$post({ json: n }, c(r));
36
+ if (!a.ok) throw new Error(`Failed to create brand: ${a.statusText}`);
45
37
  return a.json();
46
38
  },
47
39
  onSuccess: () => {
48
- s.invalidateQueries({ queryKey: i.admin.orders.all });
40
+ s.invalidateQueries({ queryKey: o.admin.brands.all });
49
41
  },
50
42
  ...e
51
43
  });
52
44
  }
53
- function j(e, r) {
54
- const { baseURL: n, authToken: s } = l(), t = y();
45
+ function $(e, t) {
46
+ const { baseURL: r, authToken: s } = d(), n = y();
55
47
  return m({
56
- mutationFn: async (o) => {
57
- const u = await d(n).orders[":id"].$patch(
58
- { param: { id: e }, json: o },
59
- c(s)
60
- );
61
- if (!u.ok)
62
- throw new Error(`Failed to update order: ${u.statusText}`);
63
- return u.json();
48
+ mutationFn: async (i) => {
49
+ const l = await u(r).brands[":id"].$patch({ json: i, param: { id: e } }, c(s));
50
+ if (!l.ok) throw new Error(`Failed to update brand: ${l.statusText}`);
51
+ return l.json();
64
52
  },
65
53
  onSuccess: () => {
66
- t.invalidateQueries({ queryKey: i.admin.orders.detail(e) }), t.invalidateQueries({ queryKey: i.admin.orders.all });
54
+ n.invalidateQueries({ queryKey: o.admin.brands.detail(e) }), n.invalidateQueries({ queryKey: o.admin.brands.all });
67
55
  },
68
- ...r
56
+ ...t
69
57
  });
70
58
  }
71
- function x(e, r) {
72
- const { baseURL: n, authToken: s } = l(), t = y();
73
- return m({
74
- mutationFn: async (o) => {
75
- const u = await d(n).orders[":id"].status.$patch(
76
- { param: { id: e }, json: o },
77
- c(s)
78
- );
79
- if (!u.ok)
80
- throw new Error(`Failed to update order status: ${u.statusText}`);
81
- return u.json();
82
- },
83
- onSuccess: () => {
84
- t.invalidateQueries({ queryKey: i.admin.orders.detail(e) }), t.invalidateQueries({ queryKey: i.admin.orders.all });
85
- },
86
- ...r
87
- });
88
- }
89
- function K(e, r) {
90
- const { baseURL: n, authToken: s } = l(), t = y();
59
+ function x(e, t) {
60
+ const { baseURL: r, authToken: s } = d(), n = y();
91
61
  return m({
92
62
  mutationFn: async () => {
93
- const a = await d(n).orders[":id"].$delete(
94
- { param: { id: e } },
95
- c(s)
96
- );
97
- if (!a.ok)
98
- throw new Error(`Failed to delete order: ${a.statusText}`);
63
+ const a = await u(r).brands[":id"].$delete({ param: { id: e } }, c(s));
64
+ if (!a.ok) throw new Error(`Failed to delete brand: ${a.statusText}`);
99
65
  return a.json();
100
66
  },
101
67
  onSuccess: () => {
102
- t.invalidateQueries({ queryKey: i.admin.orders.all });
68
+ n.invalidateQueries({ queryKey: o.admin.brands.all });
103
69
  },
104
- ...r
70
+ ...t
105
71
  });
106
72
  }
107
73
  export {
108
- $ as useCreateOrder,
109
- K as useDeleteOrder,
110
- T as useGetOrder,
111
- F as useListOrders,
112
- j as useUpdateOrder,
113
- x as useUpdateOrderStatus
74
+ T as useCreateBrand,
75
+ x as useDeleteBrand,
76
+ F as useGetBrand,
77
+ k as useListBrands,
78
+ $ as useUpdateBrand
114
79
  };