Skip to content

Sample State

Christopher Lee edited this page Dec 28, 2017 · 4 revisions
{
  entities: {
    photos: {
      1: {
        id: 1,
        title: 'picture1',
        description: 'this is a picture',
        image: image_url,
        author_id: 8,
        likes: 100,
        comments: ['comment1', 'comment2', 'comment3'],
        tags: ['tag1', 'tag2', 'tag3']
      },
      2: {
        id: 2,
        title: 'picture2'
        description: 'this is a picture',
        image: image_url,
        author_id: 8,
        likes: 50,
        comments: ['comment1', 'comment2', 'comment3'],
        tags: ['tag1', 'tag2', 'tag3']
      }
      3: {
        id: 3,
        title: 'picture3'
        description: 'this is a picture',
        image: image_url,
        author_id: 10,
        likes: 200,
        comments: ['comment1', 'comment2', 'comment3'],
        tags: ['tag1', 'tag2', 'tag3']
      }
    },
    comments: {
      1: {
        id: 1,
        author_id: 8
        photo_id: 3,
        body: "I like this picture."
      }
      2: {
        id: 2,
        author_id: 10
        photo_id: 1,
        body: "Wow look at this picture!"
      }
      3: {
        id: 3,
        author_id: 10
        photo_id: 2,
        body: "This picture is ok."
      }
    },
    users: {
      8: {
        id: 8,
        username: 'Batman',
        description: "I'm Batman",
        about: "Batman has many sidekicks such as Robin, Batgirl, and Nightwing."
        profile_picture: 'image_url',
        profile_url: 'www.aperture.com/batman',
        photos: [1, 2],
        followers: 500,
        following: [10, 12],
        affection: 9000,
        photo_views: 100000
      },
      10: {
        id: 10,
        username: 'Superman',
        description: "I'm Superman",
        about: "I'm the Man of Steel.",
        profile_picture: 'image_url',
        profile_url: 'www.aperture.com/superman',
        photos: [3],
        followers: 500,
        following: [8, 12],
        affection: 9000,
        photo_views: 100000
      },
      12: {
        id: 10,
        username: 'Wonderwoman',
        description: "Where's Steve?!",
        about: "I'm an Amazonian Princess",
        profile_picture: 'image_url',
        profile_url: 'www.aperture.com/wonderwoman',
        photos: [],
        followers: 500,
        following: [8, 10],
        affection: 9000,
        photo_views: 100000
      },
    },
  },
  ui: {
    loading: true/false
  },
  session: {
    id: 101,
    username: "Batman",
    profile_url: 'www.aperture.com/batman'
  }
  errors: {
    sign_up: ["Username/Password does not satisfy requirements."],
    log_in: ["Incorrect Username/Password combination."]
  }
}

Clone this wiki locally