@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.
|
@@ -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(
|
|
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
|
};
|