fix: add /mobile prefix to all client-side fetch() calls for basePath
This commit is contained in:
@@ -14,7 +14,7 @@ export default function NotificationBell() {
|
||||
const fetchUnreadCount = async () => {
|
||||
if (!token) return;
|
||||
try {
|
||||
const res = await fetch("/api/notifications/unread-count", {
|
||||
const res = await fetch("/mobile/api/notifications/unread-count", {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
if (res.ok) {
|
||||
|
||||
@@ -65,7 +65,7 @@ export default function NotificationPanel({
|
||||
const fetchNotifications = useCallback(async () => {
|
||||
if (!token) return;
|
||||
try {
|
||||
const res = await fetch("/api/notifications", {
|
||||
const res = await fetch("/mobile/api/notifications", {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
if (res.ok) {
|
||||
@@ -86,7 +86,7 @@ export default function NotificationPanel({
|
||||
const markAsRead = async (id: string) => {
|
||||
if (!token) return;
|
||||
try {
|
||||
const res = await fetch("/api/notifications", {
|
||||
const res = await fetch("/mobile/api/notifications", {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -108,7 +108,7 @@ export default function NotificationPanel({
|
||||
const markAllAsRead = async () => {
|
||||
if (!token) return;
|
||||
try {
|
||||
const res = await fetch("/api/notifications", {
|
||||
const res = await fetch("/mobile/api/notifications", {
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -130,7 +130,7 @@ export default function NotificationPanel({
|
||||
const refreshCount = async () => {
|
||||
if (!token) return;
|
||||
try {
|
||||
const res = await fetch("/api/notifications/unread-count", {
|
||||
const res = await fetch("/mobile/api/notifications/unread-count", {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
if (res.ok) {
|
||||
|
||||
Reference in New Issue
Block a user