@go-avro/avro-js 0.0.2-beta.154 → 0.0.2-beta.155

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.
@@ -311,6 +311,7 @@ declare module '../client/QueryClient' {
311
311
  id: string;
312
312
  }, StandardError, {
313
313
  user_id: string;
314
+ data: Partial<UserCompanyAssociation>;
314
315
  }>>;
315
316
  useRemoveUserCompany(): ReturnType<typeof useMutation<{
316
317
  msg: string;
@@ -95,11 +95,11 @@ AvroQueryClient.prototype.useUpdateCompany = function () {
95
95
  AvroQueryClient.prototype.useCreateUserCompany = function () {
96
96
  const queryClient = this.getQueryClient();
97
97
  return useMutation({
98
- mutationFn: async ({ user_id }) => {
98
+ mutationFn: async ({ user_id, data }) => {
99
99
  if (!user_id) {
100
100
  throw new Error("Both userId and companyId are required");
101
101
  }
102
- return this.post(`/company/${this.companyId}/user/${user_id}`, JSON.stringify({ user_id: user_id }), undefined, { "Content-Type": "application/json" });
102
+ return this.post(`/company/${this.companyId}/user/${user_id}`, JSON.stringify(data), undefined, { "Content-Type": "application/json" });
103
103
  },
104
104
  onMutate: async ({ user_id }) => {
105
105
  await queryClient.cancelQueries({ queryKey: ['company', this.companyId] });
@@ -122,6 +122,7 @@ AvroQueryClient.prototype.useCreateUserCompany = function () {
122
122
  onSettled: (_data, _error, variables) => {
123
123
  queryClient.invalidateQueries({ queryKey: ['company', this.companyId] });
124
124
  queryClient.invalidateQueries({ queryKey: ['/company/list'] });
125
+ queryClient.invalidateQueries({ queryKey: ['company', 'current'] });
125
126
  },
126
127
  });
127
128
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.2-beta.154",
3
+ "version": "0.0.2-beta.155",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",