Skip to content

Commit 30fc14e

Browse files
authored
Merge pull request #2442 from bluewave-labs/fix/notifications-team-id
fix: remove team id from notifications
2 parents 1850655 + 0240966 commit 30fc14e

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

client/src/Hooks/useNotifications.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,12 @@ const useGetNotificationsByTeamId = (updateTrigger) => {
3737
const [notifications, setNotifications] = useState([]);
3838
const [isLoading, setIsLoading] = useState(false);
3939
const [error, setError] = useState(null);
40-
const { user } = useSelector((state) => state.auth);
4140
const { t } = useTranslation();
4241

4342
const getNotifications = useCallback(async () => {
4443
try {
4544
setIsLoading(true);
46-
const response = await networkService.getNotificationsByTeamId({
47-
teamId: user.teamId,
48-
});
45+
const response = await networkService.getNotificationsByTeamId();
4946
setNotifications(response?.data?.data ?? []);
5047
} catch (error) {
5148
setError(error);
@@ -55,7 +52,7 @@ const useGetNotificationsByTeamId = (updateTrigger) => {
5552
} finally {
5653
setIsLoading(false);
5754
}
58-
}, [user.teamId]);
55+
}, [t]);
5956

6057
useEffect(() => {
6158
getNotifications();

client/src/Pages/Notifications/index.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
useDeleteNotification,
1818
} from "../../Hooks/useNotifications";
1919
import { useTranslation } from "react-i18next";
20-
import { useParams } from "react-router-dom";
2120

2221
const Notifications = () => {
2322
const navigate = useNavigate();

client/src/Utils/NetworkService.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,8 +996,7 @@ class NetworkService {
996996
}
997997

998998
async getNotificationsByTeamId(config) {
999-
const { teamId } = config;
1000-
return this.axiosInstance.get(`/notifications/team/${teamId}`);
999+
return this.axiosInstance.get(`/notifications/team`);
10011000
}
10021001

10031002
async deleteNotificationById(config) {

0 commit comments

Comments
 (0)