@@ -197,7 +197,7 @@ export function fetchWine(wineId) {
197
197
export function toggleWineLiked ( ) {
198
198
return ( dispatch , state ) => {
199
199
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` , {
201
201
method : 'post' ,
202
202
headers : {
203
203
'Accept' : 'application/json' ,
@@ -221,7 +221,7 @@ export function toggleWineLiked() {
221
221
222
222
export function fetchWineLiked ( ) {
223
223
return ( dispatch , state ) => {
224
- fetch ( `http://localhost:3000 /api/wines/${ state ( ) . currentWine . wine . id } /like` )
224
+ fetch ( `/api/wines/${ state ( ) . currentWine . wine . id } /like` )
225
225
. then ( r => r . json ( ) )
226
226
. then ( data => {
227
227
dispatch ( setCurrentLiked ( data . like ) ) ;
@@ -232,7 +232,7 @@ export function fetchWineLiked() {
232
232
233
233
export function fetchComments ( wineId ) {
234
234
return ( dispatch , state ) => {
235
- fetch ( `http://localhost:3000 /api/wines/${ wineId } /comments` )
235
+ fetch ( `/api/wines/${ wineId } /comments` )
236
236
. then ( r => r . json ( ) )
237
237
. then ( comments => {
238
238
dispatch ( setCurrentComments ( comments . sort ( ( a , b ) => new Date ( b . date ) - new Date ( a . date ) ) ) ) ;
@@ -243,7 +243,7 @@ export function fetchComments(wineId) {
243
243
244
244
export function postComment ( wineId , comment ) {
245
245
return ( dispatch , state ) => {
246
- fetch ( `http://localhost:3000 /api/wines/${ wineId } /comments` , {
246
+ fetch ( `/api/wines/${ wineId } /comments` , {
247
247
method : 'post' ,
248
248
headers : {
249
249
'Accept' : 'application/json' ,
0 commit comments