Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
sujata
/
Akruti-Frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 45857fab
authored
2026-03-30 15:55:59 +0530
by
Ravindra Kanojiya
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
updated header slice
1 parent
d4a59b1e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
redux/slices/headerSlice.js
redux/slices/headerSlice.js
View file @
45857fa
// store/HeaderSlice.js
import
{
createSlice
,
createAsyncThunk
}
from
"@reduxjs/toolkit"
;
import
axios
from
"axios"
;
import
qs
from
"qs"
;
export
const
fetchHeader
=
createAsyncThunk
(
"HeaderSlice
/fetchHeader"
,
"Header
/fetchHeader"
,
async
()
=>
{
const
query
=
{
populate
:
[
"headerLeft"
,
"headerRight.image"
,
],
populate
:
[
"headerLeft"
,
"headerRight.image"
],
};
const
queryString
=
qs
.
stringify
(
query
,
{
encodeValuesOnly
:
true
,
});
const
endpoint
=
`
${
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/headers?
${
queryString
}
`
;
const
response
=
await
axios
.
get
(
endpoint
);
return
response
.
data
.
data
;
}
);
...
...
@@ -43,4 +46,5 @@ const HeaderSlice = createSlice({
});
},
});
export
default
HeaderSlice
.
reducer
;
\ No newline at end of file
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment