@go-avro/avro-js 0.0.2-beta.54 → 0.0.2-beta.56

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.
@@ -94,6 +94,15 @@ declare module '../client/QueryClient' {
94
94
  companyId: string;
95
95
  jobData: Partial<Job>;
96
96
  }>>;
97
+ useCreateSelf(): ReturnType<typeof useMutation<{
98
+ msg: string;
99
+ }, StandardError, {
100
+ username: string;
101
+ name: string;
102
+ email: string;
103
+ password: string;
104
+ phone_number: string;
105
+ }>>;
97
106
  useUpdateEvent(): ReturnType<typeof useMutation<{
98
107
  msg: string;
99
108
  }, StandardError, {
@@ -14,6 +14,17 @@ AvroQueryClient.prototype.useGetSelf = function () {
14
14
  enabled: Boolean(this),
15
15
  });
16
16
  };
17
+ AvroQueryClient.prototype.useCreateSelf = function () {
18
+ const queryClient = useQueryClient();
19
+ return useMutation({
20
+ mutationFn: async (data) => {
21
+ return this.post('/user', JSON.stringify(data), undefined, { "Content-Type": "application/json" });
22
+ },
23
+ onSettled: () => {
24
+ queryClient.invalidateQueries({ queryKey: ['user'] });
25
+ },
26
+ });
27
+ };
17
28
  AvroQueryClient.prototype.useDeleteSelf = function () {
18
29
  const queryClient = useQueryClient();
19
30
  return useMutation({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.2-beta.54",
3
+ "version": "0.0.2-beta.56",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",