Commit 582cf0a5 authored by Daniel Puchala's avatar Daniel Puchala
Browse files

feat: deletion added (not working yet)

parent 60b82558
......@@ -90,7 +90,7 @@ export const Movie = () => {
{reviews.map((review: any) =>
<Review averageRating={
getAverageRating(review)}
userId={review.user.id}
userId={+review.user.id}
text={review.text}
userName={review.user.name}
key={review.id}
......
import { getUser } from '../services/auth';
import { getToken, getUser } from '../services/auth';
import instance from '../models/axios';
export interface ReviewProps {
userId: number,
......@@ -10,6 +11,15 @@ export interface ReviewProps {
export const Review = ({userId, text, averageRating, userName}: ReviewProps) => {
const user = getUser();
// const deleteReview = async () => {
// const headers = {
// 'Content-Type': 'application/json',
// 'Authorization': getToken()
// };
// await instance.delete('reviews/delete', { headers });
// alert('Review deleted');
// };
return (
<div className="w-full h-40 p-2">
<div className="border-solid border-4 border-slate-900 bg-slate-300 w-full h-full p-2 ">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment