Merge pull request #2442 from bluewave-labs/fix/notifications-team-id
fix: remove team id from notifications
This commit is contained in:
3 files changed
+3
-8
No files matched your search
@@ -37,15 +37,12 @@ const useGetNotificationsByTeamId = (updateTrigger) => {
|
|||||||
const [notifications, setNotifications] = useState([]);
|
const [notifications, setNotifications] = useState([]);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [error, setError] = useState(null);
|
const [error, setError] = useState(null);
|
||||||
const { user } = useSelector((state) => state.auth);
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const getNotifications = useCallback(async () => {
|
const getNotifications = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
const response = await networkService.getNotificationsByTeamId({
|
const response = await networkService.getNotificationsByTeamId();
|
||||||
teamId: user.teamId,
|
|
||||||
});
|
|
||||||
setNotifications(response?.data?.data ?? []);
|
setNotifications(response?.data?.data ?? []);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setError(error);
|
setError(error);
|
||||||
@@ -55,7 +52,7 @@ const useGetNotificationsByTeamId = (updateTrigger) => {
|
|||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
}, [user.teamId]);
|
}, [t]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getNotifications();
|
getNotifications();
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import {
|
|||||||
useDeleteNotification,
|
useDeleteNotification,
|
||||||
} from "../../Hooks/useNotifications";
|
} from "../../Hooks/useNotifications";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useParams } from "react-router-dom";
|
|
||||||
|
|
||||||
const Notifications = () => {
|
const Notifications = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|||||||
@@ -996,8 +996,7 @@ class NetworkService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getNotificationsByTeamId(config) {
|
async getNotificationsByTeamId(config) {
|
||||||
const { teamId } = config;
|
return this.axiosInstance.get(`/notifications/team`);
|
||||||
return this.axiosInstance.get(`/notifications/team/${teamId}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteNotificationById(config) {
|
async deleteNotificationById(config) {
|
||||||
|
|||||||
Reference in new issue
Block a user