@go-avro/avro-js 0.0.2-beta.126 → 0.0.2-beta.127

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.
@@ -241,7 +241,6 @@ declare module '../client/QueryClient' {
241
241
  useRemoveUserCompany(): ReturnType<typeof useMutation<{
242
242
  msg: string;
243
243
  }, StandardError, {
244
- companyId: string;
245
244
  userId: string;
246
245
  }>>;
247
246
  useDeleteEvent(): ReturnType<typeof useMutation<{
@@ -81,13 +81,13 @@ AvroQueryClient.prototype.useUpdateCompany = function () {
81
81
  AvroQueryClient.prototype.useRemoveUserCompany = function () {
82
82
  const queryClient = this.getQueryClient();
83
83
  return useMutation({
84
- mutationFn: async ({ companyId, userId }) => {
85
- return this.delete(`/company/${companyId}/user/${userId}`);
84
+ mutationFn: async ({ userId }) => {
85
+ return this.delete(`/company/${this.companyId}/user/${userId}`);
86
86
  },
87
- onMutate: async ({ companyId, userId }) => {
88
- await queryClient.cancelQueries({ queryKey: ['company', companyId] });
89
- const previousCompany = queryClient.getQueryData(['company', companyId]);
90
- queryClient.setQueryData(['company', companyId], (oldData) => {
87
+ onMutate: async ({ userId }) => {
88
+ await queryClient.cancelQueries({ queryKey: ['company', this.companyId] });
89
+ const previousCompany = queryClient.getQueryData(['company', this.companyId]);
90
+ queryClient.setQueryData(['company', this.companyId], (oldData) => {
91
91
  if (!oldData)
92
92
  return oldData;
93
93
  return {
@@ -98,14 +98,12 @@ AvroQueryClient.prototype.useRemoveUserCompany = function () {
98
98
  return { previousCompany };
99
99
  },
100
100
  onError: (err, variables, context) => {
101
- const { companyId } = variables;
102
101
  if (context?.previousCompany) {
103
- queryClient.setQueryData(['company', companyId], context.previousCompany);
102
+ queryClient.setQueryData(['company', this.companyId], context.previousCompany);
104
103
  }
105
104
  },
106
105
  onSettled: (_data, _error, variables) => {
107
- const { companyId } = variables;
108
- queryClient.invalidateQueries({ queryKey: ['company', companyId] });
106
+ queryClient.invalidateQueries({ queryKey: ['company', this.companyId] });
109
107
  },
110
108
  });
111
109
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.2-beta.126",
3
+ "version": "0.0.2-beta.127",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",