Skip to content

Sample State

Warlin Felipe Reyes edited this page Dec 29, 2017 · 5 revisions
{
  entities: {
    boards: {
          /*May remove the supposed like feature and change it to a pin to board
          feature*/
      1: {
        id: 1,
        title: "Fitness Board",
        author_id: 11,
        likes: 12,
        pins: [26]
      },
      2: {
        id: 2,
        body: "Health food Board",
        author_id: 25,
        likes: 45,
        current_user_likes: true,
        pins: []
      },
      3: {
        id: 3,
        body: "Stylish Cars board",
        author_id: 25,
        likes: 16,
        current_user_likes: true
        pins: [27, 28, 29]
      }
    },
    users: {
      11: {
        id: 11,
        username: "Warlin1102",
        img_url: "some_uploaded_image.jpg",
        follows: [23, 25],
        following: [23, 25]
      }
      23: {
        id: 23,
        username: "Batarang",
        img_url: "some_uploaded_image.jpg",
        follows: [11, 25],
        following: [11, 25]
      },
      25: {
        id: 25,
        username: "Batman_22",
        img_url: "some_uploaded_image.jpg",
        follows: [23, 11]
        following: [23, 11]
      }
    }
  },
  pins: {
    25: {
        // pins don't necessarily need to have a board id as users can just create them and other users
        // can pin them to their board
        id: 25,
        title: How to clean sneakers,
        description: 'Get jason marx!',
        user_id: 1,
        },
    26: {
        id: 26,
        title: Calisthenic training,
        description: 'Flawless workout to get in shape!',
        url: some-workout-website.io,
        user_id: 1,
        board_id: 1
        },
   27: {
        id: 27,
        title: Acura NSX,
        description: '1995 model 😍',
        url: carthings.io,
        user_id: 3,
        board_id: 3
        },
  },
  ui: {
    loading: true/false
  },
  errors: {
    login: ["Incorrect username/password combination"],
    BoardCreate: ["Board title can't be blank"],
    PinCreate: ["Pin title can't be blank", "url can't be blank"]
  },
  session: {
    id: 57,
  }
}

Clone this wiki locally