@timardex/cluemart-shared 1.5.786 → 1.5.787

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.
@@ -5176,6 +5176,54 @@ var useGetAffiliates = () => {
5176
5176
  };
5177
5177
  };
5178
5178
 
5179
+ // src/graphql/hooks/affiliate/hooksMutation.ts
5180
+ import { useMutation as useMutation20 } from "@apollo/client";
5181
+
5182
+ // src/graphql/mutations/affiliate.ts
5183
+ import { gql as gql41 } from "@apollo/client";
5184
+ var UPDATE_AFFILIATE_DETAILS_MUTATION = gql41`
5185
+ mutation updateAffiliateDetails(
5186
+ $input: AffiliateDetailsInputType!
5187
+ $affiliateId: ID!
5188
+ ) {
5189
+ updateAffiliateDetails(input: $input, affiliateId: $affiliateId) {
5190
+ ...AffiliateFields
5191
+ }
5192
+ }
5193
+ ${AFFILIATE_FIELDS_FRAGMENT}
5194
+ `;
5195
+ var DELETE_AFFILIATE_MUTATION = gql41`
5196
+ mutation deleteAffiliate($_id: ID!) {
5197
+ deleteAffiliate(_id: $_id)
5198
+ }
5199
+ `;
5200
+
5201
+ // src/graphql/hooks/affiliate/hooksMutation.ts
5202
+ var useUpdateAffiliateDetails = () => {
5203
+ const [updateAffiliateDetails, { loading, error }] = useMutation20(
5204
+ UPDATE_AFFILIATE_DETAILS_MUTATION,
5205
+ {
5206
+ awaitRefetchQueries: true,
5207
+ refetchQueries: (mutationResult) => {
5208
+ const affiliateId = mutationResult?.data?.updateAffiliateDetails?._id;
5209
+ if (!affiliateId) return [];
5210
+ return [{ query: GET_AFFILIATE, variables: { _id: affiliateId } }];
5211
+ }
5212
+ }
5213
+ );
5214
+ return { error, loading, updateAffiliateDetails };
5215
+ };
5216
+ var useDeleteAffiliate = () => {
5217
+ const [deleteAffiliate, { loading, error }] = useMutation20(
5218
+ DELETE_AFFILIATE_MUTATION,
5219
+ {
5220
+ awaitRefetchQueries: true,
5221
+ refetchQueries: [{ query: GET_AFFILIATES }]
5222
+ }
5223
+ );
5224
+ return { deleteAffiliate, error, loading };
5225
+ };
5226
+
5179
5227
  export {
5180
5228
  GET_EVENT,
5181
5229
  GET_EVENT_INFO,
@@ -5327,6 +5375,8 @@ export {
5327
5375
  useGetSchools,
5328
5376
  useGetSchool,
5329
5377
  useGetAffiliate,
5330
- useGetAffiliates
5378
+ useGetAffiliates,
5379
+ useUpdateAffiliateDetails,
5380
+ useDeleteAffiliate
5331
5381
  };
5332
- //# sourceMappingURL=chunk-YYRWWHUW.mjs.map
5382
+ //# sourceMappingURL=chunk-JP76OR4F.mjs.map