@singi-labs/sifa-sdk 0.12.32 → 0.12.33

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.
@@ -653,6 +653,12 @@ function updateSkill(config, rkey, data, options = {}) {
653
653
  ...options
654
654
  });
655
655
  }
656
+ function updateSkillSubCategories(config, rkeys, subCategory, options = {}) {
657
+ return apiWrite(config, "/api/profile/skills/subcategory", "POST", {
658
+ body: { rkeys, subCategory },
659
+ ...options
660
+ });
661
+ }
656
662
  function deleteSkill(config, rkey, options = {}) {
657
663
  return apiWrite(config, `/api/profile/skill/${encodeURIComponent(rkey)}`, "DELETE", options);
658
664
  }
@@ -691,6 +697,24 @@ function useUpdateSkill(ownerHandleOrDid, options) {
691
697
  ...options
692
698
  });
693
699
  }
700
+ function useUpdateSkillSubCategories(ownerHandleOrDid, options) {
701
+ const config = useSifaConfig();
702
+ const queryClient = reactQuery.useQueryClient();
703
+ return reactQuery.useMutation({
704
+ mutationFn: ({ rkeys, subCategory }) => updateSkillSubCategories(config, rkeys, subCategory),
705
+ // `...options` comes first so a caller-supplied onSuccess cannot replace the
706
+ // wrapper below and silently skip profile invalidation; the wrapper calls it
707
+ // instead. The older skill hooks in this file spread options last and still
708
+ // carry that bug.
709
+ ...options,
710
+ onSuccess: async (result, variables, onMutateResult, context) => {
711
+ if (result.success) {
712
+ await invalidateProfile3(queryClient, ownerHandleOrDid);
713
+ }
714
+ await options?.onSuccess?.(result, variables, onMutateResult, context);
715
+ }
716
+ });
717
+ }
694
718
  function useDeleteSkill(ownerHandleOrDid, options) {
695
719
  const config = useSifaConfig();
696
720
  const queryClient = reactQuery.useQueryClient();
@@ -2721,6 +2745,7 @@ exports.useUpdateProfileOverride = useUpdateProfileOverride;
2721
2745
  exports.useUpdateProfileSelf = useUpdateProfileSelf;
2722
2746
  exports.useUpdateRecord = useUpdateRecord;
2723
2747
  exports.useUpdateSkill = useUpdateSkill;
2748
+ exports.useUpdateSkillSubCategories = useUpdateSkillSubCategories;
2724
2749
  exports.useUploadAvatar = useUploadAvatar;
2725
2750
  exports.useVerifyExternalAccount = useVerifyExternalAccount;
2726
2751
  exports.useWipePreview = useWipePreview;