l-min-components 1.6.1231 → 1.6.1233

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.6.1231",
3
+ "version": "1.6.1233",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -765,38 +765,45 @@ const useMessageKit = (/*affiliatesActive*/) => {
765
765
  }),
766
766
  };
767
767
  });
768
-
769
- let response;
770
- if (selectedAccount.type.toLowerCase() === "enterprise") {
771
- response = await request({
772
- url: `/notify/v1/enterprise/rooms/${roomId}/change_pin_status/`,
773
- method: "POST",
774
- });
775
- }
776
- if (
777
- selectedAccount.type.toLowerCase() === "instructor" &&
778
- affiliateAccount
779
- // &&
780
- // affiliatesActive
781
- ) {
782
- response = await request({
783
- url: `/notify/v1/instructor/${affiliateAccount}/rooms/${roomId}/change_pin_status/`,
784
- method: "POST",
785
- });
786
- } // incomplete
787
-
788
- if (!response?.data) {
768
+ try {
769
+ let response;
770
+ if (selectedAccount.type.toLowerCase() === "enterprise") {
771
+ response = await request({
772
+ url: `/notify/v1/enterprise/rooms/${roomId}/change_pin_status/`,
773
+ method: "patch",
774
+ });
775
+ }
776
+ if (
777
+ selectedAccount.type.toLowerCase() === "instructor" &&
778
+ affiliateAccount
779
+ // &&
780
+ // affiliatesActive
781
+ ) {
782
+ response = await request({
783
+ url: `/notify/v1/instructor/${affiliateAccount}/rooms/${roomId}/change_pin_status/`,
784
+ method: "patch",
785
+ });
786
+ } // incomplete
787
+ } catch (err) {
789
788
  // Revert optimistic update on failure (optional, depends on desired UX)
790
789
  // You might want to implement more specific error handling here
791
790
  getMessageRoomsByCourses(null, true);
792
- return;
793
791
  }
794
- const isPinned = response.data.detail === "True";
792
+
793
+ // const isPinned = response.data.detail === "True";
795
794
  // The optimistic update should ideally handle the UI change,
796
795
  // so no further state update might be needed here based on the response.
797
796
  // However, you could add a check to ensure the optimistic update matches the server response.
798
797
  };
799
798
 
799
+ const deleteRoom = async (roomId) => {
800
+ let response;
801
+ if (selectedAccount.type.toLowerCase() === "enterprise") {
802
+ response = await request({
803
+ url: ``,
804
+ });
805
+ }
806
+ };
800
807
  // Initial data fetch effect
801
808
  useEffect(() => {
802
809
  (async () => {