Skip to content

Sample State

Alison Cheng edited this page Sep 18, 2017 · 2 revisions

Sample State

{
  entities: {
    users: {
      1: {
        id: 1,
        username: 'ThomYork',
       image_url: '/images/1',
       profile_url: ‘/profiles/1’,
       QuestionsMatch: 25,
       Location: London, England
      },
      2: {
        id: 2,
        Username: 'Guest'
       image_url: '/images/2',
       Profile_url: ‘/profiles/2’,
       QuestionsMatch: 80
       Location: 'San Francisco, CA',
      },
    },
   Messages:{
     1: {
      	user_id: 1,
      	Content: "hello world"
      }
     2: {
      	user_id: 2,
      	Content: "hello world"
      }
    }
   },
   Questions: {
     1: {
       question_id : 1,
       question_body: 'True or False: It's ok to show up late to band practice',
       answers:[
        'true',
        'false'
       ]
     }
   }
   Question Answers: {
      1: {
        Question id : 1,
        Answer id: 3,
        user_id: 1
      }
    },
    Profiles: {
       1: {
         User_id:  1
        About_me: 'I'm a electronic musician'
        Instrument: 'Laptop'
          details:{
            age: 27
            sex: 'female'
          }
        }
    }
   },
  ui: {
    users_loading: true/false,
    questions_loading: true/false
  },
  errors: {
    login: ["Incorrect username/password combination"],
    userCreation: ['password must be 6 characters'],
    Question:  ["Question answer cannot be blank"],
  },
  session: {
    id: 1,
    username: 'Thom Yorke',
    image_url: '/images/1'
  }
}

Clone this wiki locally