@@ -197,7 +197,7 @@ export function fetchWine(wineId) {
197197export function toggleWineLiked ( ) {
198198 return ( dispatch , state ) => {
199199 const currentLike = state ( ) . currentWine . liked ;
200- fetch ( `http://localhost:3000 /api/wines/${ state ( ) . currentWine . wine . id } /like` , {
200+ fetch ( `/api/wines/${ state ( ) . currentWine . wine . id } /like` , {
201201 method : 'post' ,
202202 headers : {
203203 'Accept' : 'application/json' ,
@@ -221,7 +221,7 @@ export function toggleWineLiked() {
221221
222222export function fetchWineLiked ( ) {
223223 return ( dispatch , state ) => {
224- fetch ( `http://localhost:3000 /api/wines/${ state ( ) . currentWine . wine . id } /like` )
224+ fetch ( `/api/wines/${ state ( ) . currentWine . wine . id } /like` )
225225 . then ( r => r . json ( ) )
226226 . then ( data => {
227227 dispatch ( setCurrentLiked ( data . like ) ) ;
@@ -232,7 +232,7 @@ export function fetchWineLiked() {
232232
233233export function fetchComments ( wineId ) {
234234 return ( dispatch , state ) => {
235- fetch ( `http://localhost:3000 /api/wines/${ wineId } /comments` )
235+ fetch ( `/api/wines/${ wineId } /comments` )
236236 . then ( r => r . json ( ) )
237237 . then ( comments => {
238238 dispatch ( setCurrentComments ( comments . sort ( ( a , b ) => new Date ( b . date ) - new Date ( a . date ) ) ) ) ;
@@ -243,7 +243,7 @@ export function fetchComments(wineId) {
243243
244244export function postComment ( wineId , comment ) {
245245 return ( dispatch , state ) => {
246- fetch ( `http://localhost:3000 /api/wines/${ wineId } /comments` , {
246+ fetch ( `/api/wines/${ wineId } /comments` , {
247247 method : 'post' ,
248248 headers : {
249249 'Accept' : 'application/json' ,
0 commit comments