Skip to content
Snippets Groups Projects
Commit 031a68d0 authored by xaralis's avatar xaralis
Browse files

feat: only display non-pending procedure proposals to non-chairmen

parent 9b1f2e54
No related branches found
No related tags found
No related merge requests found
...@@ -146,6 +146,14 @@ const PostsContainer = ({ className }) => { ...@@ -146,6 +146,14 @@ const PostsContainer = ({ className }) => {
const sliceStart = (window.page - 1) * window.perPage; const sliceStart = (window.page - 1) * window.perPage;
const sliceEnd = window.page * window.perPage; const sliceEnd = window.page * window.perPage;
let windowItems = window.items.map((postId) => items[postId]);
// Only display proposals verified by chairman to other users.
if (!user || user.role !== "chairman") {
windowItems = windowItems.filter(
(item) => item.type === "post" || item.state !== "pending"
);
}
return ( return (
<> <>
...@@ -155,9 +163,7 @@ const PostsContainer = ({ className }) => { ...@@ -155,9 +163,7 @@ const PostsContainer = ({ className }) => {
</ErrorMessage> </ErrorMessage>
)} )}
<PostList <PostList
items={window.items items={windowItems.slice(sliceStart, sliceEnd)}
.slice(sliceStart, sliceEnd)
.map((postId) => items[postId])}
canThumb={isAuthenticated} canThumb={isAuthenticated}
canRunActions={isAuthenticated && user.role === "chairman"} canRunActions={isAuthenticated && user.role === "chairman"}
onLike={like.run} onLike={like.run}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment