@go-avro/avro-js 0.0.2-beta.93 → 0.0.2-beta.94

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.
@@ -120,6 +120,13 @@ declare module '../client/QueryClient' {
120
120
  custom_emails: [string, string][];
121
121
  };
122
122
  }>>;
123
+ useCreateCompany(): ReturnType<typeof useMutation<{
124
+ id: string;
125
+ }, StandardError, {
126
+ companyData: Partial<Company | {
127
+ logo: File | null;
128
+ }>;
129
+ }>>;
123
130
  useCreateJob(): ReturnType<typeof useMutation<{
124
131
  id: string;
125
132
  }, StandardError, {
@@ -14,6 +14,17 @@ AvroQueryClient.prototype.useGetCompany = function (companyId) {
14
14
  enabled: Boolean(companyId),
15
15
  });
16
16
  };
17
+ AvroQueryClient.prototype.useCreateCompany = function () {
18
+ const queryClient = useQueryClient();
19
+ return useMutation({
20
+ mutationFn: async ({ companyData }) => {
21
+ return this.post(`/company`, JSON.stringify(companyData), undefined, { "Content-Type": "application/json" });
22
+ },
23
+ onSettled: () => {
24
+ queryClient.invalidateQueries({ queryKey: ['/company/list'] });
25
+ },
26
+ });
27
+ };
17
28
  AvroQueryClient.prototype.useUpdateCompany = 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.93",
3
+ "version": "0.0.2-beta.94",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",