remove team id from notificaitons

This commit is contained in:
Alex Holliday
2025-06-13 11:15:42 +08:00
parent 1a7842164d
commit 024096631f
3 changed files with 3 additions and 8 deletions

View File

@@ -37,15 +37,12 @@ const useGetNotificationsByTeamId = (updateTrigger) => {
const [notifications, setNotifications] = useState([]);
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState(null);
const { user } = useSelector((state) => state.auth);
const { t } = useTranslation();
const getNotifications = useCallback(async () => {
try {
setIsLoading(true);
const response = await networkService.getNotificationsByTeamId({
teamId: user.teamId,
});
const response = await networkService.getNotificationsByTeamId();
setNotifications(response?.data?.data ?? []);
} catch (error) {
setError(error);
@@ -55,7 +52,7 @@ const useGetNotificationsByTeamId = (updateTrigger) => {
} finally {
setIsLoading(false);
}
}, [user.teamId]);
}, [t]);
useEffect(() => {
getNotifications();

View File

@@ -17,7 +17,6 @@ import {
useDeleteNotification,
} from "../../Hooks/useNotifications";
import { useTranslation } from "react-i18next";
import { useParams } from "react-router-dom";
const Notifications = () => {
const navigate = useNavigate();

View File

@@ -996,8 +996,7 @@ class NetworkService {
}
async getNotificationsByTeamId(config) {
const { teamId } = config;
return this.axiosInstance.get(`/notifications/team/${teamId}`);
return this.axiosInstance.get(`/notifications/team`);
}
async deleteNotificationById(config) {