Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sweepstake
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arjun Jhukal
sweepstake
Commits
ed3a0c5f
Commit
ed3a0c5f
authored
Oct 15, 2025
by
Arjun Jhukal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated the server menu base query and next config
parent
d1a80c88
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
6 deletions
+31
-6
next.config.ts
next.config.ts
+1
-1
menu.ts
src/serverApi/menu.ts
+1
-2
baseQuery.ts
src/services/baseQuery.ts
+29
-3
No files found.
next.config.ts
View file @
ed3a0c5f
...
@@ -21,7 +21,7 @@ const nextConfig: NextConfig = {
...
@@ -21,7 +21,7 @@ const nextConfig: NextConfig = {
return
[
return
[
{
{
source
:
'/api/backend/:path*'
,
// Requests to /api/backend/* from your frontend
source
:
'/api/backend/:path*'
,
// Requests to /api/backend/* from your frontend
destination
:
'https://app.bdwebai.com/
api/
:path*'
,
// Will be rewritten to your Laravel API
destination
:
'https://app.bdwebai.com/:path*'
,
// Will be rewritten to your Laravel API
},
},
];
];
},
},
...
...
src/serverApi/menu.ts
View file @
ed3a0c5f
...
@@ -3,4 +3,4 @@ import { serverBaseQuery } from "./serverBaseQuery";
...
@@ -3,4 +3,4 @@ import { serverBaseQuery } from "./serverBaseQuery";
export
async
function
getAllMenus
():
Promise
<
MenuResponse
>
{
export
async
function
getAllMenus
():
Promise
<
MenuResponse
>
{
return
serverBaseQuery
(
"/api/general/menus"
);
return
serverBaseQuery
(
"/api/general/menus"
);
}
}
\ No newline at end of file
src/services/baseQuery.ts
View file @
ed3a0c5f
// import { RootState } from "@/hooks/store";
// import { fetchBaseQuery } from "@reduxjs/toolkit/query/react";
// export const baseQuery = fetchBaseQuery({
// baseUrl: process.env.NEXT_PUBLIC_BASE_URL,
// credentials: 'include',
// prepareHeaders(headers, { getState }) {
// const token = (getState() as RootState).auth.access_token;
// headers.set("Accept", "application/json");
// headers.set("Content-Type", "application/json");
// if (token) {
// headers.set("Authorization", `Bearer ${token}`);
// }
// return headers;
// },
// });
// src/services/baseQuery.ts
import
{
RootState
}
from
"@/hooks/store"
;
import
{
RootState
}
from
"@/hooks/store"
;
import
{
fetchBaseQuery
}
from
"@reduxjs/toolkit/query/react"
;
import
{
fetchBaseQuery
}
from
"@reduxjs/toolkit/query/react"
;
export
const
baseQuery
=
fetchBaseQuery
({
export
const
baseQuery
=
fetchBaseQuery
({
baseUrl
:
process
.
env
.
NEXT_PUBLIC_BASE_URL
,
// Use your Next.js frontend URL + proxy path
credentials
:
'include'
,
// Example: https://sweepstake.webjuwa.com/api/backend OR localhost:3000/api/backend
prepareHeaders
(
headers
,
{
getState
})
{
baseUrl
:
(
process
.
env
.
NEXT_PUBLIC_FRONTEND_URL
||
""
)
+
"/api/backend"
,
credentials
:
"include"
,
prepareHeaders
:
(
headers
,
{
getState
})
=>
{
const
token
=
(
getState
()
as
RootState
).
auth
.
access_token
;
const
token
=
(
getState
()
as
RootState
).
auth
.
access_token
;
headers
.
set
(
"Accept"
,
"application/json"
);
headers
.
set
(
"Accept"
,
"application/json"
);
headers
.
set
(
"Content-Type"
,
"application/json"
);
headers
.
set
(
"Content-Type"
,
"application/json"
);
if
(
token
)
{
if
(
token
)
{
headers
.
set
(
"Authorization"
,
`Bearer
${
token
}
`
);
headers
.
set
(
"Authorization"
,
`Bearer
${
token
}
`
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment