Skip to content

Commit

Permalink
Mooderation Phase-1 (#1207)
Browse files Browse the repository at this point in the history
* fixing

* lint

* fixing

* Moderation

* Moderation fix

* Moderation fix

* Moderation fix

---------

Co-authored-by: Tapas Adhikary <tapas.adhikary@gmail.com>
  • Loading branch information
yung-coder and atapas committed Jul 10, 2023
1 parent 1a8abdc commit 132b2f3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 12 deletions.
23 changes: 13 additions & 10 deletions src/common/Testimonial/TestimonialModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,19 @@ export default function TestimonialModal({ isOpen, setIsOpen }) {
try {
let response = await submit(insert_testimonial_submission(testimonialData));
setIsOpen(false);
toast.success('Testimonial added', {
position: 'top-right',
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: 'light'
});
toast.success(
'Thank you! Your Testimonial has been submitted for a review and we will publish it soon',
{
position: 'top-right',
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: 'light'
}
);

return response;
} catch (error) {
Expand Down
1 change: 0 additions & 1 deletion src/common/Testimonial/TestimonialSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ function TestimonialSection() {
const res = await submit(fetchTestimonialsHomePage());
setTestimonials(res);
};

useEffect(() => {
fetchTestimonials();
}, []);
Expand Down
28 changes: 27 additions & 1 deletion src/common/services/request/query/testimonials.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ export const fetchFiltered = {
function: 'testimonials',
write: false,
limit: 9,
where: {
clause: {
conditions: [
{
field: 'moderated',
operator: 'eq',
value: true,
type: 'boolean'
}
]
}
},
return: [
'id',
'quote',
Expand All @@ -25,6 +37,19 @@ export const fetchAll = {
name: 'test',
function: 'testimonials',
write: false,
where: {
clause: {
conditions: [
{
field: 'moderated',
operator: 'eq',
value: true,
type: 'boolean'
}
]
}
},

return: [
'id',
'quote',
Expand Down Expand Up @@ -87,7 +112,8 @@ export const insert_testimonial_submission = (testimonialData) => {
object: {
event: testimonialData.event,
quote: testimonialData.quote,
user: testimonialData.id
user: testimonialData.id,
moderated: false
},
return: ['id']
};
Expand Down

1 comment on commit 132b2f3

@vercel
Copy link

@vercel vercel bot commented on 132b2f3 Jul 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

react-play – ./

reactoplay.vercel.app
react-play-reactplayio.vercel.app
react-play-git-main-reactplayio.vercel.app

Please sign in to comment.