Skip to content

TypeError: Cannot read property 'url' of undefined #57

@erdemalkan

Description

@erdemalkan

In the list pages, the description images come as files. Therefore, I think that "url" in the relevant lines in api.js file should be changed to "uri".

Application fails because "url" cannot be found.

lib/api.js

diff --git a/lib/api.js b/lib/api.js
index 9a3b9a6..034a62b 100644
--- a/lib/api.js
+++ b/lib/api.js
@@ -38,7 +38,7 @@ export function findAllPromotedRecipes(limit = 4) {
fields: {
recipes: 'title,difficulty,image',
images: 'name,thumbnail',

  •  files: 'filename,url',
    
  •  files: 'filename,uri',
    
    },
    sort: '-created',
    };
    @@ -64,7 +64,7 @@ export function findAllLatestRecipes(limit = 4, offset = 0) {
    fields: {
    recipes: 'title,difficulty,image',
    images: 'name,thumbnail',
  •  files: 'filename,url',
    
  •  files: 'filename,uri',
    
    },
    };
    return jsonApi.get('recipes', query);
    @@ -89,7 +89,7 @@ export function findHomePromotedArticlesAndRecipes(limit) {
    fields: {
    recipes: 'contentType,title,difficulty,image',
    images: 'name,thumbnail',
  •  files: 'filename,url',
    
  •  files: 'filename,uri',
     contentTypes: 'type',
    
    },
    sort: '-created',
    @@ -112,7 +112,7 @@ export function findHomePromotedArticlesAndRecipes(limit) {
    fields: {
    recipes: 'title,difficulty,image',
    images: 'name,thumbnail',
  •  files: 'filename,url',
    
  •  files: 'filename,uri',
     contentTypes: 'type',
    
    },
    sort: '-created',
    @@ -146,7 +146,7 @@ export function findAllRecipesByCategoryName(
    fields: {
    recipes: 'title,difficulty,image',
    images: 'name,thumbnail',
  •  files: 'filename,url',
    
  •  files: 'filename,uri',
    
    },
    page: {
    offset: 0,
    @@ -173,7 +173,7 @@ export function findAllRecipesByDifficultyName(
    fields: {
    recipes: 'title,difficulty,image',
    images: 'name,thumbnail',
  •  files: 'filename,url',
    
  •  files: 'filename,uri',
    
    },
    page: {
    offset: 0,
    @@ -203,7 +203,7 @@ export function findAllRecipesByMaxTotalTime(
    fields: {
    recipes: 'title,difficulty,image',
    images: 'name,thumbnail',
  •  files: 'filename,url',
    
  •  files: 'filename,uri',
    
    },
    page: {
    offset: 0,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions