Skip to content

Astrogram State

Pavel Aparcana edited this page Mar 20, 2020 · 4 revisions

Astrogram Sample State

{
  entities: {
    posts: {
      1: {
        id: 1,
        imageSrc: "11102019_1.jpg",
        authorId: 1,
        caption: "sample caption Loream Ipsum",
        comments: 9,
        likes: 100,
        commentIds: [1, 10, 12,...]
      },
      2: {
        id: 2,
        imageSrc: "11102019_2.jpg",
        authorId: 2,
        caption: "sample caption 2 Loream Ipsum",
        comments: 13,
        likes: 100,
        commentIds: [2, 3, ...]
      },
      3: {
        id: 3,
        imageSrc: "11102019_3.jpg",
        authorId: 3,
        caption: "sample caption 3 Loream Ipsum",
        comments: 3,
        likes: 100,
        commentIds: [2, 3, 5]
      }
    },
    users: {
      1: {
        id: 1,
        username: "sampleUser1",
        postsIds:[1, 3, 10]
      },
      2: {
        id: 2,
        username: "sampleUser2",
        postsIds: [ 2, 4, 5]
      },
      3: {
        id: 3,
        username: "sampleUser3",
        postsIds: [ 6, 7, 8]
      }
    },
    comments: {
      1: {
        id: 1,
        authorId: 2,
        postId: 1,
        body: "sample comment for image 1"
      },
      2: {
        id: 2,
        authorId: 1,
        postId: 2,
        body: "sample comment for image 2"
      }
    }
  }, 
  ui: {
    loading: true / false
  },
  errors: {
    login: [
      "Incorrect username/password"
    ],
    imageUploadForm: [
      "Must Select an image"
    ]
  },
  session: { 
    currentUserId: 23
  }
}

Clone this wiki locally