Skip to content

Commit

Permalink
Merge pull request #50 from Dium-dev/25-reviews
Browse files Browse the repository at this point in the history
Add reviews API url into reviews server action
  • Loading branch information
JohanMejia77 authored Apr 10, 2024
2 parents 43710d2 + 15142be commit 333e85b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/actions/reviews.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"use server";

import { REVIEWS_API } from "@/lib/constants";

export const getReviews = async () => {
try {
const response = await fetch("http://localhost:3005/reviews");
const response = await fetch(REVIEWS_API);
const { data } = await response.json();
return data;
} catch (_) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Reviews/ReviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const ReviewCard = ({ review }: ReviewCardProps) => {
<div className="flex flex-col justify-center items-center ms:items-start">
<p className="text-lg">{review.user}</p>
<StarRatings
rating={3}
rating={+review.rating}
numberOfStars={5}
starRatedColor="orange"
starDimension="30px"
Expand Down
3 changes: 2 additions & 1 deletion src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,5 @@ export const PAYMENT_METHODS = [
title: 'Compra segura',
description: 'Tu seguridad es nuestra prioridad. Utilizamos tecnología SSL y métodos de pago verificados para proteger tus datos sin riesgos.'
}
]
]
export const REVIEWS_API = "https://landingatc-back-end.onrender.com/reviews"

0 comments on commit 333e85b

Please sign in to comment.