@replyke/core 5.0.0-beta.5 → 5.0.0-beta.8

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.
Files changed (383) hide show
  1. package/dist/cjs/config/axios.js +1 -3
  2. package/dist/cjs/config/axios.js.map +1 -1
  3. package/dist/cjs/hooks/app-notifications/useCountUnreadNotifications.js +4 -6
  4. package/dist/cjs/hooks/app-notifications/useCountUnreadNotifications.js.map +1 -1
  5. package/dist/cjs/hooks/app-notifications/useFetchAppNotifications.js +4 -6
  6. package/dist/cjs/hooks/app-notifications/useFetchAppNotifications.js.map +1 -1
  7. package/dist/cjs/hooks/app-notifications/useMarkNotificationAsRead.js +3 -6
  8. package/dist/cjs/hooks/app-notifications/useMarkNotificationAsRead.js.map +1 -1
  9. package/dist/cjs/hooks/auth/useAuthData.js +6 -8
  10. package/dist/cjs/hooks/auth/useAuthData.js.map +1 -1
  11. package/dist/cjs/hooks/auth/useChangePassword.d.ts +1 -3
  12. package/dist/cjs/hooks/auth/useChangePassword.js +6 -16
  13. package/dist/cjs/hooks/auth/useChangePassword.js.map +1 -1
  14. package/dist/cjs/hooks/auth/useRequestNewAccessToken.js +4 -6
  15. package/dist/cjs/hooks/auth/useRequestNewAccessToken.js.map +1 -1
  16. package/dist/cjs/hooks/auth/useSignInWithEmailAndPassword.d.ts +1 -2
  17. package/dist/cjs/hooks/auth/useSignInWithEmailAndPassword.js +7 -14
  18. package/dist/cjs/hooks/auth/useSignInWithEmailAndPassword.js.map +1 -1
  19. package/dist/cjs/hooks/auth/useSignOut.js +3 -6
  20. package/dist/cjs/hooks/auth/useSignOut.js.map +1 -1
  21. package/dist/cjs/hooks/auth/useSignUpWithEmailAndPassword.d.ts +1 -2
  22. package/dist/cjs/hooks/auth/useSignUpWithEmailAndPassword.js +7 -14
  23. package/dist/cjs/hooks/auth/useSignUpWithEmailAndPassword.js.map +1 -1
  24. package/dist/cjs/hooks/auth/useVerifyExternalUser.js +3 -4
  25. package/dist/cjs/hooks/auth/useVerifyExternalUser.js.map +1 -1
  26. package/dist/cjs/hooks/comments/index.d.ts +3 -2
  27. package/dist/cjs/hooks/comments/index.js +7 -5
  28. package/dist/cjs/hooks/comments/index.js.map +1 -1
  29. package/dist/cjs/hooks/comments/useCommentSectionData.js +4 -4
  30. package/dist/cjs/hooks/comments/useCommentSectionData.js.map +1 -1
  31. package/dist/cjs/hooks/comments/useCommentVotes.js.map +1 -1
  32. package/dist/cjs/hooks/comments/useCreateComment.d.ts +4 -0
  33. package/dist/cjs/hooks/comments/useCreateComment.js +9 -7
  34. package/dist/cjs/hooks/comments/useCreateComment.js.map +1 -1
  35. package/dist/cjs/hooks/comments/useDeleteComment.js +3 -6
  36. package/dist/cjs/hooks/comments/useDeleteComment.js.map +1 -1
  37. package/dist/cjs/hooks/comments/useDownvoteComment.js +4 -6
  38. package/dist/cjs/hooks/comments/useDownvoteComment.js.map +1 -1
  39. package/dist/cjs/hooks/comments/useEntityComments.js +5 -5
  40. package/dist/cjs/hooks/comments/useEntityComments.js.map +1 -1
  41. package/dist/{esm/hooks/comments/useFetchSingleComment.d.ts → cjs/hooks/comments/useFetchComment.d.ts} +2 -2
  42. package/dist/cjs/hooks/comments/{useFetchSingleComment.js → useFetchComment.js} +9 -11
  43. package/dist/cjs/hooks/comments/useFetchComment.js.map +1 -0
  44. package/dist/cjs/hooks/comments/useFetchCommentByForeignId.d.ts +9 -0
  45. package/dist/cjs/hooks/comments/useFetchCommentByForeignId.js +75 -0
  46. package/dist/cjs/hooks/comments/useFetchCommentByForeignId.js.map +1 -0
  47. package/dist/cjs/hooks/comments/{useFetchComments.d.ts → useFetchManyComments.d.ts} +2 -2
  48. package/dist/cjs/hooks/comments/{useFetchComments.js → useFetchManyComments.js} +7 -9
  49. package/dist/cjs/hooks/comments/useFetchManyComments.js.map +1 -0
  50. package/dist/cjs/hooks/comments/useProfileComments.js +5 -5
  51. package/dist/cjs/hooks/comments/useProfileComments.js.map +1 -1
  52. package/dist/cjs/hooks/comments/useRemoveCommentDownvote.js +4 -6
  53. package/dist/cjs/hooks/comments/useRemoveCommentDownvote.js.map +1 -1
  54. package/dist/cjs/hooks/comments/useRemoveCommentUpvote.js +4 -6
  55. package/dist/cjs/hooks/comments/useRemoveCommentUpvote.js.map +1 -1
  56. package/dist/cjs/hooks/comments/useReplies.js +3 -3
  57. package/dist/cjs/hooks/comments/useReplies.js.map +1 -1
  58. package/dist/cjs/hooks/comments/useUpdateComment.js +4 -6
  59. package/dist/cjs/hooks/comments/useUpdateComment.js.map +1 -1
  60. package/dist/cjs/hooks/comments/useUpvoteComment.js +4 -6
  61. package/dist/cjs/hooks/comments/useUpvoteComment.js.map +1 -1
  62. package/dist/cjs/hooks/crypto/index.d.ts +0 -1
  63. package/dist/cjs/hooks/crypto/index.js +1 -3
  64. package/dist/cjs/hooks/crypto/index.js.map +1 -1
  65. package/dist/cjs/hooks/crypto/useSignTestingJwt.js +2 -3
  66. package/dist/cjs/hooks/crypto/useSignTestingJwt.js.map +1 -1
  67. package/dist/cjs/hooks/entities/useCreateEntity.d.ts +3 -0
  68. package/dist/cjs/hooks/entities/useCreateEntity.js +10 -15
  69. package/dist/cjs/hooks/entities/useCreateEntity.js.map +1 -1
  70. package/dist/cjs/hooks/entities/useDeleteEntity.js +3 -6
  71. package/dist/cjs/hooks/entities/useDeleteEntity.js.map +1 -1
  72. package/dist/cjs/hooks/entities/useDownvoteEntity.js +4 -6
  73. package/dist/cjs/hooks/entities/useDownvoteEntity.js.map +1 -1
  74. package/dist/cjs/hooks/entities/useFeedData.d.ts +5 -5
  75. package/dist/cjs/hooks/entities/useFeedData.js +8 -8
  76. package/dist/cjs/hooks/entities/useFeedData.js.map +1 -1
  77. package/dist/cjs/hooks/entities/useFetchEntity.js +4 -6
  78. package/dist/cjs/hooks/entities/useFetchEntity.js.map +1 -1
  79. package/dist/cjs/hooks/entities/useFetchEntityByForeignId.js +4 -6
  80. package/dist/cjs/hooks/entities/useFetchEntityByForeignId.js.map +1 -1
  81. package/dist/cjs/hooks/entities/useFetchEntityByShortId.js +4 -6
  82. package/dist/cjs/hooks/entities/useFetchEntityByShortId.js.map +1 -1
  83. package/dist/cjs/hooks/entities/useFetchManyEntities.d.ts +2 -2
  84. package/dist/cjs/hooks/entities/useFetchManyEntities.js +6 -8
  85. package/dist/cjs/hooks/entities/useFetchManyEntities.js.map +1 -1
  86. package/dist/cjs/hooks/entities/useIncrementEntityViews.js +3 -6
  87. package/dist/cjs/hooks/entities/useIncrementEntityViews.js.map +1 -1
  88. package/dist/cjs/hooks/entities/useRemoveEntityDownvote.js +4 -6
  89. package/dist/cjs/hooks/entities/useRemoveEntityDownvote.js.map +1 -1
  90. package/dist/cjs/hooks/entities/useRemoveEntityUpvote.js +4 -6
  91. package/dist/cjs/hooks/entities/useRemoveEntityUpvote.js.map +1 -1
  92. package/dist/cjs/hooks/entities/useUpdateEntity.d.ts +2 -1
  93. package/dist/cjs/hooks/entities/useUpdateEntity.js +7 -8
  94. package/dist/cjs/hooks/entities/useUpdateEntity.js.map +1 -1
  95. package/dist/cjs/hooks/entities/useUpvoteEntity.js +4 -6
  96. package/dist/cjs/hooks/entities/useUpvoteEntity.js.map +1 -1
  97. package/dist/cjs/hooks/lists/useAddToList.js +4 -7
  98. package/dist/cjs/hooks/lists/useAddToList.js.map +1 -1
  99. package/dist/cjs/hooks/lists/useCreateList.js +4 -6
  100. package/dist/cjs/hooks/lists/useCreateList.js.map +1 -1
  101. package/dist/cjs/hooks/lists/useDeleteList.js +3 -10
  102. package/dist/cjs/hooks/lists/useDeleteList.js.map +1 -1
  103. package/dist/cjs/hooks/lists/useFetchRootList.js +4 -6
  104. package/dist/cjs/hooks/lists/useFetchRootList.js.map +1 -1
  105. package/dist/cjs/hooks/lists/useFetchSubLists.js +4 -10
  106. package/dist/cjs/hooks/lists/useFetchSubLists.js.map +1 -1
  107. package/dist/cjs/hooks/lists/useIsEntitySaved.js +4 -6
  108. package/dist/cjs/hooks/lists/useIsEntitySaved.js.map +1 -1
  109. package/dist/cjs/hooks/lists/useRemoveFromList.js +4 -7
  110. package/dist/cjs/hooks/lists/useRemoveFromList.js.map +1 -1
  111. package/dist/cjs/hooks/lists/useUpdateList.js +4 -7
  112. package/dist/cjs/hooks/lists/useUpdateList.js.map +1 -1
  113. package/dist/cjs/hooks/projects/useProjectData.js +1 -1
  114. package/dist/cjs/hooks/projects/useProjectData.js.map +1 -1
  115. package/dist/cjs/hooks/reports/index.d.ts +1 -1
  116. package/dist/cjs/hooks/reports/index.js +3 -3
  117. package/dist/{esm/hooks/reports/useSubmitReport.d.ts → cjs/hooks/reports/useCreateReport.d.ts} +4 -4
  118. package/dist/cjs/hooks/reports/{useSubmitReport.js → useCreateReport.js} +11 -14
  119. package/dist/cjs/hooks/reports/useCreateReport.js.map +1 -0
  120. package/dist/cjs/hooks/storage/useUploadFile.js +3 -4
  121. package/dist/cjs/hooks/storage/useUploadFile.js.map +1 -1
  122. package/dist/cjs/hooks/users/follows/index.js.map +1 -0
  123. package/dist/cjs/hooks/{relationships → users/follows}/useFetchFollow.js +7 -14
  124. package/dist/cjs/hooks/users/follows/useFetchFollow.js.map +1 -0
  125. package/dist/cjs/hooks/{relationships → users/follows}/useFollowUser.js +7 -11
  126. package/dist/cjs/hooks/users/follows/useFollowUser.js.map +1 -0
  127. package/dist/cjs/hooks/{relationships → users/follows}/useUnfollowUser.js +7 -14
  128. package/dist/cjs/hooks/users/follows/useUnfollowUser.js.map +1 -0
  129. package/dist/cjs/hooks/users/index.d.ts +2 -1
  130. package/dist/cjs/hooks/users/index.js +7 -3
  131. package/dist/cjs/hooks/users/index.js.map +1 -1
  132. package/dist/cjs/hooks/users/useCheckUsernameAvailability.js +6 -6
  133. package/dist/cjs/hooks/users/useCheckUsernameAvailability.js.map +1 -1
  134. package/dist/{esm/hooks/users/useFetchSingleUser.d.ts → cjs/hooks/users/useFetchUser.d.ts} +2 -2
  135. package/dist/cjs/hooks/users/{useFetchSingleUser.js → useFetchUser.js} +9 -11
  136. package/dist/cjs/hooks/users/useFetchUser.js.map +1 -0
  137. package/dist/cjs/hooks/users/useFetchUserByForeignId.d.ts +5 -0
  138. package/dist/cjs/hooks/{styles/useFetchStyle.js → users/useFetchUserByForeignId.js} +23 -12
  139. package/dist/cjs/hooks/users/useFetchUserByForeignId.js.map +1 -0
  140. package/dist/cjs/hooks/users/useFetchUserFollowersCount.js +4 -6
  141. package/dist/cjs/hooks/users/useFetchUserFollowersCount.js.map +1 -1
  142. package/dist/cjs/hooks/users/useFetchUserFollowingCount.js +4 -6
  143. package/dist/cjs/hooks/users/useFetchUserFollowingCount.js.map +1 -1
  144. package/dist/cjs/hooks/users/useFetchUserSuggestions.d.ts +3 -1
  145. package/dist/cjs/hooks/users/useFetchUserSuggestions.js +9 -10
  146. package/dist/cjs/hooks/users/useFetchUserSuggestions.js.map +1 -1
  147. package/dist/cjs/hooks/users/useMentions.js +1 -1
  148. package/dist/cjs/hooks/users/useMentions.js.map +1 -1
  149. package/dist/cjs/hooks/users/useUpdateUser.js +4 -6
  150. package/dist/cjs/hooks/users/useUpdateUser.js.map +1 -1
  151. package/dist/cjs/hooks/utils/index.js.map +1 -0
  152. package/dist/cjs/hooks/{general → utils}/useGetMetadata.js +4 -6
  153. package/dist/cjs/hooks/utils/useGetMetadata.js.map +1 -0
  154. package/dist/cjs/index.d.ts +4 -6
  155. package/dist/cjs/index.js +12 -16
  156. package/dist/cjs/index.js.map +1 -1
  157. package/dist/cjs/interfaces/entity-filters/AttachmentsFilters.d.ts +3 -0
  158. package/dist/cjs/interfaces/entity-filters/{MediaFilters.js → AttachmentsFilters.js} +1 -1
  159. package/dist/cjs/interfaces/entity-filters/AttachmentsFilters.js.map +1 -0
  160. package/dist/esm/config/axios.js +1 -3
  161. package/dist/esm/config/axios.js.map +1 -1
  162. package/dist/esm/hooks/app-notifications/useCountUnreadNotifications.js +4 -6
  163. package/dist/esm/hooks/app-notifications/useCountUnreadNotifications.js.map +1 -1
  164. package/dist/esm/hooks/app-notifications/useFetchAppNotifications.js +4 -6
  165. package/dist/esm/hooks/app-notifications/useFetchAppNotifications.js.map +1 -1
  166. package/dist/esm/hooks/app-notifications/useMarkNotificationAsRead.js +3 -6
  167. package/dist/esm/hooks/app-notifications/useMarkNotificationAsRead.js.map +1 -1
  168. package/dist/esm/hooks/auth/useAuthData.js +6 -8
  169. package/dist/esm/hooks/auth/useAuthData.js.map +1 -1
  170. package/dist/esm/hooks/auth/useChangePassword.d.ts +1 -3
  171. package/dist/esm/hooks/auth/useChangePassword.js +6 -16
  172. package/dist/esm/hooks/auth/useChangePassword.js.map +1 -1
  173. package/dist/esm/hooks/auth/useRequestNewAccessToken.js +4 -6
  174. package/dist/esm/hooks/auth/useRequestNewAccessToken.js.map +1 -1
  175. package/dist/esm/hooks/auth/useSignInWithEmailAndPassword.d.ts +1 -2
  176. package/dist/esm/hooks/auth/useSignInWithEmailAndPassword.js +7 -14
  177. package/dist/esm/hooks/auth/useSignInWithEmailAndPassword.js.map +1 -1
  178. package/dist/esm/hooks/auth/useSignOut.js +3 -6
  179. package/dist/esm/hooks/auth/useSignOut.js.map +1 -1
  180. package/dist/esm/hooks/auth/useSignUpWithEmailAndPassword.d.ts +1 -2
  181. package/dist/esm/hooks/auth/useSignUpWithEmailAndPassword.js +7 -14
  182. package/dist/esm/hooks/auth/useSignUpWithEmailAndPassword.js.map +1 -1
  183. package/dist/esm/hooks/auth/useVerifyExternalUser.js +3 -4
  184. package/dist/esm/hooks/auth/useVerifyExternalUser.js.map +1 -1
  185. package/dist/esm/hooks/comments/index.d.ts +3 -2
  186. package/dist/esm/hooks/comments/index.js +3 -2
  187. package/dist/esm/hooks/comments/index.js.map +1 -1
  188. package/dist/esm/hooks/comments/useCommentSectionData.js +4 -4
  189. package/dist/esm/hooks/comments/useCommentSectionData.js.map +1 -1
  190. package/dist/esm/hooks/comments/useCommentVotes.js.map +1 -1
  191. package/dist/esm/hooks/comments/useCreateComment.d.ts +4 -0
  192. package/dist/esm/hooks/comments/useCreateComment.js +9 -7
  193. package/dist/esm/hooks/comments/useCreateComment.js.map +1 -1
  194. package/dist/esm/hooks/comments/useDeleteComment.js +3 -6
  195. package/dist/esm/hooks/comments/useDeleteComment.js.map +1 -1
  196. package/dist/esm/hooks/comments/useDownvoteComment.js +4 -6
  197. package/dist/esm/hooks/comments/useDownvoteComment.js.map +1 -1
  198. package/dist/esm/hooks/comments/useEntityComments.js +5 -5
  199. package/dist/esm/hooks/comments/useEntityComments.js.map +1 -1
  200. package/dist/{cjs/hooks/comments/useFetchSingleComment.d.ts → esm/hooks/comments/useFetchComment.d.ts} +2 -2
  201. package/dist/esm/hooks/comments/{useFetchSingleComment.js → useFetchComment.js} +9 -11
  202. package/dist/esm/hooks/comments/useFetchComment.js.map +1 -0
  203. package/dist/esm/hooks/comments/useFetchCommentByForeignId.d.ts +9 -0
  204. package/dist/esm/hooks/comments/useFetchCommentByForeignId.js +70 -0
  205. package/dist/esm/hooks/comments/useFetchCommentByForeignId.js.map +1 -0
  206. package/dist/esm/hooks/comments/{useFetchComments.d.ts → useFetchManyComments.d.ts} +2 -2
  207. package/dist/esm/hooks/comments/{useFetchComments.js → useFetchManyComments.js} +7 -9
  208. package/dist/esm/hooks/comments/useFetchManyComments.js.map +1 -0
  209. package/dist/esm/hooks/comments/useProfileComments.js +5 -5
  210. package/dist/esm/hooks/comments/useProfileComments.js.map +1 -1
  211. package/dist/esm/hooks/comments/useRemoveCommentDownvote.js +4 -6
  212. package/dist/esm/hooks/comments/useRemoveCommentDownvote.js.map +1 -1
  213. package/dist/esm/hooks/comments/useRemoveCommentUpvote.js +4 -6
  214. package/dist/esm/hooks/comments/useRemoveCommentUpvote.js.map +1 -1
  215. package/dist/esm/hooks/comments/useReplies.js +3 -3
  216. package/dist/esm/hooks/comments/useReplies.js.map +1 -1
  217. package/dist/esm/hooks/comments/useUpdateComment.js +4 -6
  218. package/dist/esm/hooks/comments/useUpdateComment.js.map +1 -1
  219. package/dist/esm/hooks/comments/useUpvoteComment.js +4 -6
  220. package/dist/esm/hooks/comments/useUpvoteComment.js.map +1 -1
  221. package/dist/esm/hooks/crypto/index.d.ts +0 -1
  222. package/dist/esm/hooks/crypto/index.js +0 -1
  223. package/dist/esm/hooks/crypto/index.js.map +1 -1
  224. package/dist/esm/hooks/crypto/useSignTestingJwt.js +2 -3
  225. package/dist/esm/hooks/crypto/useSignTestingJwt.js.map +1 -1
  226. package/dist/esm/hooks/entities/useCreateEntity.d.ts +3 -0
  227. package/dist/esm/hooks/entities/useCreateEntity.js +10 -15
  228. package/dist/esm/hooks/entities/useCreateEntity.js.map +1 -1
  229. package/dist/esm/hooks/entities/useDeleteEntity.js +3 -6
  230. package/dist/esm/hooks/entities/useDeleteEntity.js.map +1 -1
  231. package/dist/esm/hooks/entities/useDownvoteEntity.js +4 -6
  232. package/dist/esm/hooks/entities/useDownvoteEntity.js.map +1 -1
  233. package/dist/esm/hooks/entities/useFeedData.d.ts +5 -5
  234. package/dist/esm/hooks/entities/useFeedData.js +8 -8
  235. package/dist/esm/hooks/entities/useFeedData.js.map +1 -1
  236. package/dist/esm/hooks/entities/useFetchEntity.js +4 -6
  237. package/dist/esm/hooks/entities/useFetchEntity.js.map +1 -1
  238. package/dist/esm/hooks/entities/useFetchEntityByForeignId.js +4 -6
  239. package/dist/esm/hooks/entities/useFetchEntityByForeignId.js.map +1 -1
  240. package/dist/esm/hooks/entities/useFetchEntityByShortId.js +4 -6
  241. package/dist/esm/hooks/entities/useFetchEntityByShortId.js.map +1 -1
  242. package/dist/esm/hooks/entities/useFetchManyEntities.d.ts +2 -2
  243. package/dist/esm/hooks/entities/useFetchManyEntities.js +6 -8
  244. package/dist/esm/hooks/entities/useFetchManyEntities.js.map +1 -1
  245. package/dist/esm/hooks/entities/useIncrementEntityViews.js +3 -6
  246. package/dist/esm/hooks/entities/useIncrementEntityViews.js.map +1 -1
  247. package/dist/esm/hooks/entities/useRemoveEntityDownvote.js +4 -6
  248. package/dist/esm/hooks/entities/useRemoveEntityDownvote.js.map +1 -1
  249. package/dist/esm/hooks/entities/useRemoveEntityUpvote.js +4 -6
  250. package/dist/esm/hooks/entities/useRemoveEntityUpvote.js.map +1 -1
  251. package/dist/esm/hooks/entities/useUpdateEntity.d.ts +2 -1
  252. package/dist/esm/hooks/entities/useUpdateEntity.js +7 -8
  253. package/dist/esm/hooks/entities/useUpdateEntity.js.map +1 -1
  254. package/dist/esm/hooks/entities/useUpvoteEntity.js +4 -6
  255. package/dist/esm/hooks/entities/useUpvoteEntity.js.map +1 -1
  256. package/dist/esm/hooks/lists/useAddToList.js +4 -7
  257. package/dist/esm/hooks/lists/useAddToList.js.map +1 -1
  258. package/dist/esm/hooks/lists/useCreateList.js +4 -6
  259. package/dist/esm/hooks/lists/useCreateList.js.map +1 -1
  260. package/dist/esm/hooks/lists/useDeleteList.js +3 -10
  261. package/dist/esm/hooks/lists/useDeleteList.js.map +1 -1
  262. package/dist/esm/hooks/lists/useFetchRootList.js +4 -6
  263. package/dist/esm/hooks/lists/useFetchRootList.js.map +1 -1
  264. package/dist/esm/hooks/lists/useFetchSubLists.js +4 -10
  265. package/dist/esm/hooks/lists/useFetchSubLists.js.map +1 -1
  266. package/dist/esm/hooks/lists/useIsEntitySaved.js +4 -6
  267. package/dist/esm/hooks/lists/useIsEntitySaved.js.map +1 -1
  268. package/dist/esm/hooks/lists/useRemoveFromList.js +4 -7
  269. package/dist/esm/hooks/lists/useRemoveFromList.js.map +1 -1
  270. package/dist/esm/hooks/lists/useUpdateList.js +4 -7
  271. package/dist/esm/hooks/lists/useUpdateList.js.map +1 -1
  272. package/dist/esm/hooks/projects/useProjectData.js +1 -1
  273. package/dist/esm/hooks/projects/useProjectData.js.map +1 -1
  274. package/dist/esm/hooks/reports/index.d.ts +1 -1
  275. package/dist/esm/hooks/reports/index.js +1 -1
  276. package/dist/{cjs/hooks/reports/useSubmitReport.d.ts → esm/hooks/reports/useCreateReport.d.ts} +4 -4
  277. package/dist/esm/hooks/reports/{useSubmitReport.js → useCreateReport.js} +11 -14
  278. package/dist/esm/hooks/reports/useCreateReport.js.map +1 -0
  279. package/dist/esm/hooks/storage/useUploadFile.js +3 -4
  280. package/dist/esm/hooks/storage/useUploadFile.js.map +1 -1
  281. package/dist/esm/hooks/users/follows/index.js.map +1 -0
  282. package/dist/esm/hooks/{relationships → users/follows}/useFetchFollow.js +7 -14
  283. package/dist/esm/hooks/users/follows/useFetchFollow.js.map +1 -0
  284. package/dist/esm/hooks/{relationships → users/follows}/useFollowUser.js +7 -11
  285. package/dist/esm/hooks/users/follows/useFollowUser.js.map +1 -0
  286. package/dist/esm/hooks/{relationships → users/follows}/useUnfollowUser.js +7 -14
  287. package/dist/esm/hooks/users/follows/useUnfollowUser.js.map +1 -0
  288. package/dist/esm/hooks/users/index.d.ts +2 -1
  289. package/dist/esm/hooks/users/index.js +2 -1
  290. package/dist/esm/hooks/users/index.js.map +1 -1
  291. package/dist/esm/hooks/users/useCheckUsernameAvailability.js +6 -6
  292. package/dist/esm/hooks/users/useCheckUsernameAvailability.js.map +1 -1
  293. package/dist/{cjs/hooks/users/useFetchSingleUser.d.ts → esm/hooks/users/useFetchUser.d.ts} +2 -2
  294. package/dist/esm/hooks/users/{useFetchSingleUser.js → useFetchUser.js} +9 -11
  295. package/dist/esm/hooks/users/useFetchUser.js.map +1 -0
  296. package/dist/esm/hooks/users/useFetchUserByForeignId.d.ts +5 -0
  297. package/dist/esm/hooks/users/useFetchUserByForeignId.js +67 -0
  298. package/dist/esm/hooks/users/useFetchUserByForeignId.js.map +1 -0
  299. package/dist/esm/hooks/users/useFetchUserFollowersCount.js +4 -6
  300. package/dist/esm/hooks/users/useFetchUserFollowersCount.js.map +1 -1
  301. package/dist/esm/hooks/users/useFetchUserFollowingCount.js +4 -6
  302. package/dist/esm/hooks/users/useFetchUserFollowingCount.js.map +1 -1
  303. package/dist/esm/hooks/users/useFetchUserSuggestions.d.ts +3 -1
  304. package/dist/esm/hooks/users/useFetchUserSuggestions.js +9 -10
  305. package/dist/esm/hooks/users/useFetchUserSuggestions.js.map +1 -1
  306. package/dist/esm/hooks/users/useMentions.js +1 -1
  307. package/dist/esm/hooks/users/useMentions.js.map +1 -1
  308. package/dist/esm/hooks/users/useUpdateUser.js +4 -6
  309. package/dist/esm/hooks/users/useUpdateUser.js.map +1 -1
  310. package/dist/esm/hooks/utils/index.js.map +1 -0
  311. package/dist/esm/hooks/{general → utils}/useGetMetadata.js +4 -6
  312. package/dist/esm/hooks/utils/useGetMetadata.js.map +1 -0
  313. package/dist/esm/index.d.ts +4 -6
  314. package/dist/esm/index.js +4 -8
  315. package/dist/esm/index.js.map +1 -1
  316. package/dist/esm/interfaces/entity-filters/AttachmentsFilters.d.ts +3 -0
  317. package/dist/esm/interfaces/entity-filters/AttachmentsFilters.js +2 -0
  318. package/dist/esm/interfaces/entity-filters/AttachmentsFilters.js.map +1 -0
  319. package/package.json +4 -5
  320. package/dist/cjs/hooks/comments/useFetchComments.js.map +0 -1
  321. package/dist/cjs/hooks/comments/useFetchSingleComment.js.map +0 -1
  322. package/dist/cjs/hooks/crypto/usePublicKey.d.ts +0 -2
  323. package/dist/cjs/hooks/crypto/usePublicKey.js +0 -76
  324. package/dist/cjs/hooks/crypto/usePublicKey.js.map +0 -1
  325. package/dist/cjs/hooks/general/index.js.map +0 -1
  326. package/dist/cjs/hooks/general/useGetMetadata.js.map +0 -1
  327. package/dist/cjs/hooks/relationships/index.js.map +0 -1
  328. package/dist/cjs/hooks/relationships/useFetchFollow.js.map +0 -1
  329. package/dist/cjs/hooks/relationships/useFollowUser.js.map +0 -1
  330. package/dist/cjs/hooks/relationships/useUnfollowUser.js.map +0 -1
  331. package/dist/cjs/hooks/reports/useSubmitReport.js.map +0 -1
  332. package/dist/cjs/hooks/styles/index.d.ts +0 -1
  333. package/dist/cjs/hooks/styles/index.js +0 -9
  334. package/dist/cjs/hooks/styles/index.js.map +0 -1
  335. package/dist/cjs/hooks/styles/useFetchStyle.d.ts +0 -3
  336. package/dist/cjs/hooks/styles/useFetchStyle.js.map +0 -1
  337. package/dist/cjs/hooks/users/useFetchSingleUser.js.map +0 -1
  338. package/dist/cjs/interfaces/entity-filters/MediaFilters.d.ts +0 -3
  339. package/dist/cjs/interfaces/entity-filters/MediaFilters.js.map +0 -1
  340. package/dist/cjs/utils/rsaEncryptBase64.d.ts +0 -1
  341. package/dist/cjs/utils/rsaEncryptBase64.js +0 -18
  342. package/dist/cjs/utils/rsaEncryptBase64.js.map +0 -1
  343. package/dist/esm/hooks/comments/useFetchComments.js.map +0 -1
  344. package/dist/esm/hooks/comments/useFetchSingleComment.js.map +0 -1
  345. package/dist/esm/hooks/crypto/usePublicKey.d.ts +0 -2
  346. package/dist/esm/hooks/crypto/usePublicKey.js +0 -71
  347. package/dist/esm/hooks/crypto/usePublicKey.js.map +0 -1
  348. package/dist/esm/hooks/general/index.js.map +0 -1
  349. package/dist/esm/hooks/general/useGetMetadata.js.map +0 -1
  350. package/dist/esm/hooks/relationships/index.js.map +0 -1
  351. package/dist/esm/hooks/relationships/useFetchFollow.js.map +0 -1
  352. package/dist/esm/hooks/relationships/useFollowUser.js.map +0 -1
  353. package/dist/esm/hooks/relationships/useUnfollowUser.js.map +0 -1
  354. package/dist/esm/hooks/reports/useSubmitReport.js.map +0 -1
  355. package/dist/esm/hooks/styles/index.d.ts +0 -1
  356. package/dist/esm/hooks/styles/index.js +0 -2
  357. package/dist/esm/hooks/styles/index.js.map +0 -1
  358. package/dist/esm/hooks/styles/useFetchStyle.d.ts +0 -3
  359. package/dist/esm/hooks/styles/useFetchStyle.js +0 -56
  360. package/dist/esm/hooks/styles/useFetchStyle.js.map +0 -1
  361. package/dist/esm/hooks/users/useFetchSingleUser.js.map +0 -1
  362. package/dist/esm/interfaces/entity-filters/MediaFilters.d.ts +0 -3
  363. package/dist/esm/interfaces/entity-filters/MediaFilters.js +0 -2
  364. package/dist/esm/interfaces/entity-filters/MediaFilters.js.map +0 -1
  365. package/dist/esm/utils/rsaEncryptBase64.d.ts +0 -1
  366. package/dist/esm/utils/rsaEncryptBase64.js +0 -12
  367. package/dist/esm/utils/rsaEncryptBase64.js.map +0 -1
  368. /package/dist/cjs/hooks/{relationships → users/follows}/index.d.ts +0 -0
  369. /package/dist/cjs/hooks/{relationships → users/follows}/index.js +0 -0
  370. /package/dist/cjs/hooks/{relationships → users/follows}/useFetchFollow.d.ts +0 -0
  371. /package/dist/cjs/hooks/{relationships → users/follows}/useFollowUser.d.ts +0 -0
  372. /package/dist/cjs/hooks/{relationships → users/follows}/useUnfollowUser.d.ts +0 -0
  373. /package/dist/cjs/hooks/{general → utils}/index.d.ts +0 -0
  374. /package/dist/cjs/hooks/{general → utils}/index.js +0 -0
  375. /package/dist/cjs/hooks/{general → utils}/useGetMetadata.d.ts +0 -0
  376. /package/dist/esm/hooks/{relationships → users/follows}/index.d.ts +0 -0
  377. /package/dist/esm/hooks/{relationships → users/follows}/index.js +0 -0
  378. /package/dist/esm/hooks/{relationships → users/follows}/useFetchFollow.d.ts +0 -0
  379. /package/dist/esm/hooks/{relationships → users/follows}/useFollowUser.d.ts +0 -0
  380. /package/dist/esm/hooks/{relationships → users/follows}/useUnfollowUser.d.ts +0 -0
  381. /package/dist/esm/hooks/{general → utils}/index.d.ts +0 -0
  382. /package/dist/esm/hooks/{general → utils}/index.js +0 -0
  383. /package/dist/esm/hooks/{general → utils}/useGetMetadata.d.ts +0 -0
@@ -37,26 +37,23 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  import useAxiosPrivate from "../../config/useAxiosPrivate";
38
38
  import useProject from "../projects/useProject";
39
39
  import useUser from "../users/useUser";
40
- function useSubmitReport() {
40
+ function useCreateReport() {
41
41
  var _this = this;
42
42
  var axios = useAxiosPrivate();
43
43
  var projectId = useProject().projectId;
44
44
  var user = useUser().user;
45
- var basePath = projectId ? "/".concat(projectId, "/reports") : null;
46
- var submitReport = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
47
- var path;
45
+ var createReport = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
48
46
  var targetId = _b.targetId, targetType = _b.targetType, reason = _b.reason, details = _b.details;
49
47
  return __generator(this, function (_c) {
50
48
  switch (_c.label) {
51
49
  case 0:
52
- if (!basePath) {
50
+ if (!projectId) {
53
51
  throw new Error("Project ID is required");
54
52
  }
55
53
  if (!user) {
56
54
  throw new Error("No user is logged in");
57
55
  }
58
- path = basePath;
59
- return [4 /*yield*/, axios.post(path, {
56
+ return [4 /*yield*/, axios.post("/".concat(projectId, "/reports"), {
60
57
  targetId: targetId,
61
58
  targetType: targetType,
62
59
  reason: reason,
@@ -68,11 +65,11 @@ function useSubmitReport() {
68
65
  }
69
66
  });
70
67
  }); };
71
- var submitCommentReport = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
68
+ var createCommentReport = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
72
69
  var targetId = _b.targetId, reason = _b.reason, details = _b.details;
73
70
  return __generator(this, function (_c) {
74
71
  switch (_c.label) {
75
- case 0: return [4 /*yield*/, submitReport({
72
+ case 0: return [4 /*yield*/, createReport({
76
73
  targetId: targetId,
77
74
  targetType: "Comment",
78
75
  reason: reason,
@@ -84,11 +81,11 @@ function useSubmitReport() {
84
81
  }
85
82
  });
86
83
  }); };
87
- var submitEntityReport = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
84
+ var createEntityReport = function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
88
85
  var targetId = _b.targetId, reason = _b.reason, details = _b.details;
89
86
  return __generator(this, function (_c) {
90
87
  switch (_c.label) {
91
- case 0: return [4 /*yield*/, submitReport({
88
+ case 0: return [4 /*yield*/, createReport({
92
89
  targetId: targetId,
93
90
  targetType: "Entity",
94
91
  reason: reason,
@@ -100,7 +97,7 @@ function useSubmitReport() {
100
97
  }
101
98
  });
102
99
  }); };
103
- return { submitCommentReport: submitCommentReport, submitEntityReport: submitEntityReport };
100
+ return { createCommentReport: createCommentReport, createEntityReport: createEntityReport };
104
101
  }
105
- export default useSubmitReport;
106
- //# sourceMappingURL=useSubmitReport.js.map
102
+ export default useCreateReport;
103
+ //# sourceMappingURL=useCreateReport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCreateReport.js","sourceRoot":"","sources":["../../../../src/hooks/reports/useCreateReport.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAE3D,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,OAAO,MAAM,kBAAkB,CAAC;AAEvC,SAAS,eAAe;IAAxB,iBAmEC;IAlEC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,YAAY,GAAG,gEAAO,EAU3B;YATC,QAAQ,cAAA,EACR,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,OAAO,aAAA;;;;oBAOP,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;oBAC5C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,qBAAM,KAAK,CAAC,IAAI,CAAC,WAAI,SAAS,aAAU,EAAE;4BACxC,QAAQ,UAAA;4BACR,UAAU,YAAA;4BACV,MAAM,QAAA;4BACN,OAAO,SAAA;yBACR,CAAC,EAAA;;oBALF,SAKE,CAAC;;;;SACJ,CAAC;IAEF,IAAM,mBAAmB,GAAG,gEAAO,EAQlC;YAPC,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,OAAO,aAAA;;;wBAMP,qBAAM,YAAY,CAAC;wBACjB,QAAQ,UAAA;wBACR,UAAU,EAAE,SAAS;wBACrB,MAAM,QAAA;wBACN,OAAO,SAAA;qBACR,CAAC,EAAA;;oBALF,SAKE,CAAC;;;;SACJ,CAAC;IAEF,IAAM,kBAAkB,GAAG,gEAAO,EAQjC;YAPC,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,OAAO,aAAA;;;wBAMP,qBAAM,YAAY,CAAC;wBACjB,QAAQ,UAAA;wBACR,UAAU,EAAE,QAAQ;wBACpB,MAAM,QAAA;wBACN,OAAO,SAAA;qBACR,CAAC,EAAA;;oBALF,SAKE,CAAC;;;;SACJ,CAAC;IAEF,OAAO,EAAE,mBAAmB,qBAAA,EAAE,kBAAkB,oBAAA,EAAE,CAAC;AACrD,CAAC;AAED,eAAe,eAAe,CAAC"}
@@ -45,13 +45,12 @@ function useUploadFile() {
45
45
  var _this = this;
46
46
  var axios = useAxiosPrivate();
47
47
  var projectId = useProject().projectId;
48
- var basePath = projectId ? "/".concat(projectId, "/storage") : null;
49
48
  var uploadFile = useCallback(function (file, pathParts) { return __awaiter(_this, void 0, void 0, function () {
50
49
  var formData, response;
51
50
  return __generator(this, function (_a) {
52
51
  switch (_a.label) {
53
52
  case 0:
54
- if (!basePath) {
53
+ if (!projectId) {
55
54
  throw new Error("No projectId available.");
56
55
  }
57
56
  if (!file || !pathParts || !Array.isArray(pathParts)) {
@@ -73,7 +72,7 @@ function useUploadFile() {
73
72
  }
74
73
  // 3) Append other form fields
75
74
  formData.append("pathParts", JSON.stringify(pathParts));
76
- return [4 /*yield*/, axios.post(basePath, formData, {
75
+ return [4 /*yield*/, axios.post("/".concat(projectId, "/storage"), formData, {
77
76
  headers: {
78
77
  "Content-Type": "multipart/form-data",
79
78
  },
@@ -83,7 +82,7 @@ function useUploadFile() {
83
82
  return [2 /*return*/, response.data]; // Return the server response
84
83
  }
85
84
  });
86
- }); }, [basePath, axios]);
85
+ }); }, [projectId, axios]);
87
86
  return uploadFile;
88
87
  }
89
88
  export default useUploadFile;
@@ -1 +1 @@
1
- {"version":3,"file":"useUploadFile.js","sourceRoot":"","sources":["../../../../src/hooks/stor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,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
@@ -35,22 +35,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  }
36
36
  };
37
37
  import { useCallback } from "react";
38
- import useAxiosPrivate from "../../config/useAxiosPrivate";
39
- import useProject from "../projects/useProject";
40
- import useUser from "../users/useUser";
38
+ import useAxiosPrivate from "../../../config/useAxiosPrivate";
39
+ import useProject from "../../projects/useProject";
40
+ import useUser from "../useUser";
41
41
  function useFetchFollow() {
42
42
  var _this = this;
43
43
  var axios = useAxiosPrivate();
44
44
  var projectId = useProject().projectId;
45
45
  var user = useUser().user;
46
- var basePath = projectId ? "/".concat(projectId, "/follows") : null;
47
46
  var fetchFollow = useCallback(function (props) { return __awaiter(_this, void 0, void 0, function () {
48
- var userId, path, response;
47
+ var userId, response;
49
48
  return __generator(this, function (_a) {
50
49
  switch (_a.label) {
51
50
  case 0:
52
51
  userId = props.userId;
53
- if (!basePath) {
52
+ if (!projectId) {
54
53
  throw new Error("No project specified");
55
54
  }
56
55
  if (!user) {
@@ -62,19 +61,13 @@ function useFetchFollow() {
62
61
  if (userId === user.id) {
63
62
  throw new Error("Users don't follow themselves");
64
63
  }
65
- path = basePath;
66
- return [4 /*yield*/, axios.get(path, {
67
- params: {
68
- followerId: user === null || user === void 0 ? void 0 : user.id,
69
- followedId: userId,
70
- },
71
- })];
64
+ return [4 /*yield*/, axios.get("/".concat(projectId, "/users/").concat(userId, "/follow"))];
72
65
  case 1:
73
66
  response = _a.sent();
74
67
  return [2 /*return*/, response.data.isFollowing];
75
68
  }
76
69
  });
77
- }); }, [axios, basePath, user]);
70
+ }); }, [axios, projectId, user]);
78
71
  return fetchFollow;
79
72
  }
80
73
  export default useFetchFollow;
@@ -0,0 +1 @@
1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,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,eAAe,cAAc,CAAC"}
@@ -35,22 +35,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  }
36
36
  };
37
37
  import { useCallback } from "react";
38
- import useAxiosPrivate from "../../config/useAxiosPrivate";
39
- import useProject from "../projects/useProject";
40
- import useUser from "../users/useUser";
38
+ import useAxiosPrivate from "../../../config/useAxiosPrivate";
39
+ import useProject from "../../projects/useProject";
40
+ import useUser from "../useUser";
41
41
  function useFollowUser() {
42
42
  var _this = this;
43
43
  var axios = useAxiosPrivate();
44
44
  var projectId = useProject().projectId;
45
45
  var user = useUser().user;
46
- var basePath = projectId ? "/".concat(projectId, "/follows") : null;
47
46
  var followUser = useCallback(function (props) { return __awaiter(_this, void 0, void 0, function () {
48
- var userId, path;
47
+ var userId;
49
48
  return __generator(this, function (_a) {
50
49
  switch (_a.label) {
51
50
  case 0:
52
51
  userId = props.userId;
53
- if (!basePath) {
52
+ if (!projectId) {
54
53
  throw new Error("No project specified");
55
54
  }
56
55
  if (!user) {
@@ -62,16 +61,13 @@ function useFollowUser() {
62
61
  if (userId === user.id) {
63
62
  throw new Error("Users can't follow themselves");
64
63
  }
65
- path = basePath;
66
- return [4 /*yield*/, axios.post(path, {
67
- followedId: userId,
68
- })];
64
+ return [4 /*yield*/, axios.post("/".concat(projectId, "/users/").concat(userId, "/follow"))];
69
65
  case 1:
70
66
  _a.sent();
71
67
  return [2 /*return*/];
72
68
  }
73
69
  });
74
- }); }, [axios, basePath, user]);
70
+ }); }, [axios, projectId, user]);
75
71
  return followUser;
76
72
  }
77
73
  export default useFollowUser;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFollowUser.js","sourceRoot":"","sources":["../../../../../src/hooks/users/follows/useFollowUser.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,SAAS,aAAa;IAAtB,iBA8BC;IA7BC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,UAAU,GAAG,WAAW,CAC5B,UAAO,KAAyB;;;;;oBACtB,MAAM,GAAK,KAAK,OAAV,CAAW;oBACzB,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,MAAM,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;wBACvB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;oBACnD,CAAC;oBAED,qBAAM,KAAK,CAAC,IAAI,CAAC,WAAI,SAAS,oBAAU,MAAM,YAAS,CAAC,EAAA;;oBAAxD,SAAwD,CAAC;;;;SAC1D,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,eAAe,aAAa,CAAC"}
@@ -35,22 +35,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  }
36
36
  };
37
37
  import { useCallback } from "react";
38
- import useAxiosPrivate from "../../config/useAxiosPrivate";
39
- import useProject from "../projects/useProject";
40
- import useUser from "../users/useUser";
38
+ import useAxiosPrivate from "../../../config/useAxiosPrivate";
39
+ import useProject from "../../projects/useProject";
40
+ import useUser from "../useUser";
41
41
  function useUnfollowUser() {
42
42
  var _this = this;
43
43
  var axios = useAxiosPrivate();
44
44
  var projectId = useProject().projectId;
45
45
  var user = useUser().user;
46
- var basePath = projectId ? "/".concat(projectId, "/follows") : null;
47
46
  var unfollowUser = useCallback(function (props) { return __awaiter(_this, void 0, void 0, function () {
48
- var userId, path;
47
+ var userId;
49
48
  return __generator(this, function (_a) {
50
49
  switch (_a.label) {
51
50
  case 0:
52
51
  userId = props.userId;
53
- if (!basePath) {
52
+ if (!projectId) {
54
53
  throw new Error("No project specified");
55
54
  }
56
55
  if (!user) {
@@ -62,19 +61,13 @@ function useUnfollowUser() {
62
61
  if (userId === user.id) {
63
62
  throw new Error("Users can't unfollow themselves");
64
63
  }
65
- path = basePath;
66
- return [4 /*yield*/, axios.delete(path, {
67
- params: {
68
- followedId: userId,
69
- followerId: user.id,
70
- },
71
- })];
64
+ return [4 /*yield*/, axios.delete("/".concat(projectId, "/users/").concat(userId, "/follow"))];
72
65
  case 1:
73
66
  _a.sent();
74
67
  return [2 /*return*/];
75
68
  }
76
69
  });
77
- }); }, [axios, basePath, user]);
70
+ }); }, [axios, projectId, user]);
78
71
  return unfollowUser;
79
72
  }
80
73
  export default useUnfollowUser;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUnfollowUser.js","sourceRoot":"","sources":["../../../../../src/hooks/users/follows/useUnfollowUser.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,SAAS,eAAe;IAAxB,iBA8BC;IA7BC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,YAAY,GAAG,WAAW,CAC9B,UAAO,KAAyB;;;;;oBACtB,MAAM,GAAK,KAAK,OAAV,CAAW;oBACzB,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,MAAM,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;wBACvB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;oBACrD,CAAC;oBAED,qBAAM,KAAK,CAAC,MAAM,CAAC,WAAI,SAAS,oBAAU,MAAM,YAAS,CAAC,EAAA;;oBAA1D,SAA0D,CAAC;;;;SAC5D,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,eAAe,eAAe,CAAC"}
@@ -1,9 +1,10 @@
1
1
  export { default as useUser } from "./useUser";
2
2
  export { default as useUserData } from "./useUserData";
3
- export { default as useFetchSingleUser } from "./useFetchSingleUser";
3
+ export { default as useFetchUser } from "./useFetchUser";
4
4
  export { default as useFetchUserFollowersCount } from "./useFetchUserFollowersCount";
5
5
  export { default as useFetchUserFollowingCount } from "./useFetchUserFollowingCount";
6
6
  export { default as useCheckUsernameAvailability } from "./useCheckUsernameAvailability";
7
7
  export { default as useFetchUserSuggestions } from "./useFetchUserSuggestions";
8
8
  export { default as useMentions } from "./useMentions";
9
9
  export { default as useUpdateUser } from "./useUpdateUser";
10
+ export { useFetchFollow, useFollowUser, useUnfollowUser } from "./follows";
@@ -1,10 +1,11 @@
1
1
  export { default as useUser } from "./useUser";
2
2
  export { default as useUserData } from "./useUserData";
3
- export { default as useFetchSingleUser } from "./useFetchSingleUser";
3
+ export { default as useFetchUser } from "./useFetchUser";
4
4
  export { default as useFetchUserFollowersCount } from "./useFetchUserFollowersCount";
5
5
  export { default as useFetchUserFollowingCount } from "./useFetchUserFollowingCount";
6
6
  export { default as useCheckUsernameAvailability } from "./useCheckUsernameAvailability";
7
7
  export { default as useFetchUserSuggestions } from "./useFetchUserSuggestions";
8
8
  export { default as useMentions } from "./useMentions";
9
9
  export { default as useUpdateUser } from "./useUpdateUser";
10
+ export { useFetchFollow, useFollowUser, useUnfollowUser } from "./follows";
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/users/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/hooks/users/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC"}
@@ -40,27 +40,27 @@ import axios from "../../config/axios";
40
40
  function useCheckUsernameAvailability() {
41
41
  var _this = this;
42
42
  var projectId = useProject().projectId;
43
- var basePath = projectId ? "/".concat(projectId, "/users") : null;
44
43
  var checkUsernameAvailability = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
45
- var path, response;
44
+ var response;
46
45
  var username = _b.username;
47
46
  return __generator(this, function (_c) {
48
47
  switch (_c.label) {
49
48
  case 0:
50
- if (!basePath) {
49
+ if (!projectId) {
51
50
  throw new Error("No project specified");
52
51
  }
53
52
  if (!username) {
54
53
  throw new Error("Please specify a username");
55
54
  }
56
- path = [basePath, "check-username"].join("/");
57
- return [4 /*yield*/, axios.get(path, { params: { username: username } })];
55
+ return [4 /*yield*/, axios.get("/".concat(projectId, "/users/check-username"), {
56
+ params: { username: username },
57
+ })];
58
58
  case 1:
59
59
  response = _c.sent();
60
60
  return [2 /*return*/, response.data];
61
61
  }
62
62
  });
63
- }); }, [basePath]);
63
+ }); }, [projectId]);
64
64
  return checkUsernameAvailability;
65
65
  }
66
66
  export default useCheckUsernameAvailability;
@@ -1 +1 @@
1
- {"version":3,"file":"useCheckUsernameAvailability.js","sourceRoot":"","sources":["../../../../src/hooks/users/useCheckUsernameAvailability.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAEvC,SAAS,4BAA4B;IAArC,iBAuBC;IAtBS,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IACnC,IAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,WAAI,SAAS,WAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IAE1D,IAAM,yBAAyB,GAAG,WAAW,CAC3C,gEAAO,EAAkC;;YAAhC,QAAQ,cAAA;;;;oBACf,IAAI,CAAC,QAAQ,EAAE,CAAC;wBACd,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,QAAQ,EAAE,CAAC;wBACd,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;oBAC/C,CAAC;oBAEK,IAAI,GAAG,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;oBACnC,qBAAM,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,QAAQ,UAAA,EAAE,EAAE,CAAC,EAAA;;oBAA1D,QAAQ,GAAG,SAA+C;oBAEhE,sBAAO,QAAQ,CAAC,IAAI,EAAC;;;SACtB,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAED,eAAe,4BAA4B,CAAC"}
1
+ {"version":3,"file":"useCheckUsernameAvailability.js","sourceRoot":"","sources":["../../../../src/hooks/users/useCheckUsernameAvailability.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAEvC,SAAS,4BAA4B;IAArC,iBAuBC;IAtBS,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAEnC,IAAM,yBAAyB,GAAG,WAAW,CAC3C,gEAAO,EAAkC;;YAAhC,QAAQ,cAAA;;;;oBACf,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,QAAQ,EAAE,CAAC;wBACd,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;oBAC/C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAAC,WAAI,SAAS,0BAAuB,EAAE;4BACrE,MAAM,EAAE,EAAE,QAAQ,UAAA,EAAE;yBACrB,CAAC,EAAA;;oBAFI,QAAQ,GAAG,SAEf;oBAEF,sBAAO,QAAQ,CAAC,IAAI,EAAC;;;SACtB,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAED,eAAe,4BAA4B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { UserLean } from "../../interfaces/models/User";
2
- declare function useFetchSingleUser(): ({ userId }: {
2
+ declare function useFetchUser(): ({ userId }: {
3
3
  userId: string;
4
4
  }) => Promise<UserLean>;
5
- export default useFetchSingleUser;
5
+ export default useFetchUser;
@@ -37,31 +37,29 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  import { useCallback } from "react";
38
38
  import useProject from "../projects/useProject";
39
39
  import axios from "../../config/axios";
40
- function useFetchSingleUser() {
40
+ function useFetchUser() {
41
41
  var _this = this;
42
42
  var projectId = useProject().projectId;
43
- var basePath = projectId ? "/".concat(projectId, "/users") : null;
44
- var fetchSingleUser = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
45
- var path, response;
43
+ var fetchUser = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
44
+ var response;
46
45
  var userId = _b.userId;
47
46
  return __generator(this, function (_c) {
48
47
  switch (_c.label) {
49
48
  case 0:
50
- if (!basePath) {
49
+ if (!projectId) {
51
50
  throw new Error("No project specified");
52
51
  }
53
52
  if (!userId) {
54
53
  throw new Error("Please specify a user ID");
55
54
  }
56
- path = [basePath, userId].join("/");
57
- return [4 /*yield*/, axios.get(path)];
55
+ return [4 /*yield*/, axios.get("/".concat(projectId, "/users/").concat(userId))];
58
56
  case 1:
59
57
  response = _c.sent();
60
58
  return [2 /*return*/, response.data];
61
59
  }
62
60
  });
63
- }); }, [basePath]);
64
- return fetchSingleUser;
61
+ }); }, [projectId]);
62
+ return fetchUser;
65
63
  }
66
- export default useFetchSingleUser;
67
- //# sourceMappingURL=useFetchSingleUser.js.map
64
+ export default useFetchUser;
65
+ //# sourceMappingURL=useFetchUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchUser.js","sourceRoot":"","sources":["../../../../src/hooks/users/useFetchUser.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAGvC,SAAS,YAAY;IAArB,iBAqBC;IApBS,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAEnC,IAAM,SAAS,GAAG,WAAW,CAC3B,gEAAO,EAA8B;;YAA5B,MAAM,YAAA;;;;oBACb,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;oBAC9C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAAC,WAAI,SAAS,oBAAU,MAAM,CAAE,CAAC,EAAA;;oBAA3D,QAAQ,GAAG,SAAgD;oBAEjE,sBAAO,QAAQ,CAAC,IAAgB,EAAC;;;SAClC,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,eAAe,YAAY,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { UserLean } from "../../interfaces/models/User";
2
+ declare function useFetchUserByForeignId(): ({ foreignId }: {
3
+ foreignId: string;
4
+ }) => Promise<UserLean>;
5
+ export default useFetchUserByForeignId;
@@ -0,0 +1,67 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { useCallback } from "react";
38
+ import useProject from "../projects/useProject";
39
+ import axios from "../../config/axios";
40
+ function useFetchUserByForeignId() {
41
+ var _this = this;
42
+ var projectId = useProject().projectId;
43
+ var fetchUserByForeignId = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
44
+ var response;
45
+ var foreignId = _b.foreignId;
46
+ return __generator(this, function (_c) {
47
+ switch (_c.label) {
48
+ case 0:
49
+ if (!projectId) {
50
+ throw new Error("No project specified");
51
+ }
52
+ if (!foreignId) {
53
+ throw new Error("Please specify a foreign ID");
54
+ }
55
+ return [4 /*yield*/, axios.get("/".concat(projectId, "/users/by-foreign-id"), {
56
+ params: { foreignId: foreignId },
57
+ })];
58
+ case 1:
59
+ response = _c.sent();
60
+ return [2 /*return*/, response.data];
61
+ }
62
+ });
63
+ }); }, [projectId]);
64
+ return fetchUserByForeignId;
65
+ }
66
+ export default useFetchUserByForeignId;
67
+ //# sourceMappingURL=useFetchUserByForeignId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchUserByForeignId.js","sourceRoot":"","sources":["../../../../src/hooks/users/useFetchUserByForeignId.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAGvC,SAAS,uBAAuB;IAAhC,iBAuBC;IAtBS,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAEnC,IAAM,oBAAoB,GAAG,WAAW,CACtC,gEAAO,EAAoC;;YAAlC,SAAS,eAAA;;;;oBAChB,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;oBACjD,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAAC,WAAI,SAAS,yBAAsB,EAAE;4BACpE,MAAM,EAAE,EAAE,SAAS,WAAA,EAAE;yBACtB,CAAC,EAAA;;oBAFI,QAAQ,GAAG,SAEf;oBAEF,sBAAO,QAAQ,CAAC,IAAgB,EAAC;;;SAClC,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED,eAAe,uBAAuB,CAAC"}
@@ -41,26 +41,24 @@ function useFetchUserFollowersCount() {
41
41
  var _this = this;
42
42
  var axios = useAxiosPrivate();
43
43
  var projectId = useProject().projectId;
44
- var basePath = projectId ? "/".concat(projectId, "/users") : null;
45
44
  var fetchUserFollowersCount = useCallback(function (userId) { return __awaiter(_this, void 0, void 0, function () {
46
- var path, response;
45
+ var response;
47
46
  return __generator(this, function (_a) {
48
47
  switch (_a.label) {
49
48
  case 0:
50
49
  if (!userId) {
51
50
  throw new Error("No userId provided.");
52
51
  }
53
- if (!basePath) {
52
+ if (!projectId) {
54
53
  throw new Error("No projectId available.");
55
54
  }
56
- path = [basePath, userId, "followers-count"].join("/");
57
- return [4 /*yield*/, axios.get(path)];
55
+ return [4 /*yield*/, axios.get("/".concat(projectId, "/users/").concat(userId, "/followers-count"))];
58
56
  case 1:
59
57
  response = _a.sent();
60
58
  return [2 /*return*/, response.data];
61
59
  }
62
60
  });
63
- }); }, [axios, basePath]);
61
+ }); }, [axios, projectId]);
64
62
  return fetchUserFollowersCount;
65
63
  }
66
64
  export default useFetchUserFollowersCount;
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchUserFollowersCount.js","sourceRoot":"","sources":["../../../../src/hooks/users/useFetchUserFollowersCount.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,SAAS,0BAA0B;IAAnC,iBAyBC;IAxBC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IACnC,IAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,WAAI,SAAS,WAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IAE1D,IAAM,uBAAuB,GAAG,WAAW,CACzC,UAAO,MAAc;;;;;oBACnB,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;oBACzC,CAAC;oBAED,IAA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AO,QAAQ,CAAC,IAAyB,EAAC;;;SAC3C,EACD,CAAC,KAAK,EAAE,SAAS,CAAC,CACnB,CAAC;IAEF,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAED,eAAe,0BAA0B,CAAC"}
@@ -41,26 +41,24 @@ function useFetchUserFollowingCount() {
41
41
  var _this = this;
42
42
  var axios = useAxiosPrivate();
43
43
  var projectId = useProject().projectId;
44
- var basePath = projectId ? "/".concat(projectId, "/users") : null;
45
44
  var fetchUserFollowingCount = useCallback(function (userId) { return __awaiter(_this, void 0, void 0, function () {
46
- var path, response;
45
+ var response;
47
46
  return __generator(this, function (_a) {
48
47
  switch (_a.label) {
49
48
  case 0:
50
49
  if (!userId) {
51
50
  throw new Error("No userId provided.");
52
51
  }
53
- if (!basePath) {
52
+ if (!projectId) {
54
53
  throw new Error("No projectId available.");
55
54
  }
56
- path = [basePath, userId, "following-count"].join("/");
57
- return [4 /*yield*/, axios.get(path)];
55
+ return [4 /*yield*/, axios.get("/".concat(projectId, "/users/").concat(userId, "/following-count"))];
58
56
  case 1:
59
57
  response = _a.sent();
60
58
  return [2 /*return*/, response.data];
61
59
  }
62
60
  });
63
- }); }, [axios, basePath]);
61
+ }); }, [axios, projectId]);
64
62
  return fetchUserFollowingCount;
65
63
  }
66
64
  export default useFetchUserFollowingCount;
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchUserFollowingCount.js","sourceRoot":"","sources":["../../../../src/hooks/users/useFetchUserFollowingCount.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,SAAS,0BAA0B;IAAnC,iBAyBC;IAxBC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC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AAC,qBAAqB,CAAC,CAAC;oBACzC,CAAC;oBAED,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAGgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,oBAAU,MAAM,qBAAkB,CAChD,EAAA;;oBAFK,QAAQ,GAAG,SAEhB;oBAED,sBAAO,QAAQ,CAAC,IAAyB,EAAC;;;SAC3C,EACD,CAAC,KAAK,EAAE,SAAS,CAAC,CACnB,CAAC;IAEF,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAED,eAAe,0BAA0B,CAAC"}
@@ -1,3 +1,5 @@
1
1
  import { UserLean } from "../../interfaces/models/User";
2
- declare function useFetchUserSuggestions(): (query: string) => Promise<UserLean[]>;
2
+ declare function useFetchUserSuggestions(): ({ query }: {
3
+ query: string;
4
+ }) => Promise<UserLean[]>;
3
5
  export default useFetchUserSuggestions;