Skip to content

Sample State

Americo Zuzunaga edited this page Apr 2, 2018 · 4 revisions

Lucha Sample State

{
  entities: {
    activities: {
      1: {
        id: 1,
        title: "run around the block",
        user_id: 11,
        likes: 12,
        comment_ids: [1, 2, 3],
        stats_id: 1,
        image_ids: [3, 6, 4]
      },
      2: {
        id: 2,
        title: "ride to work",
        user_id: 13,
        likes: 9,
        comment_ids: [4, 5, 6],
        stats_id: 2,
        image_ids: [2]
      },
      3: {
        id: 3,
        title: "swim to Alcatraz",
        user_id: 23,
        likes: 25,
        comment_ids: [7, 8, 9, 10],
        stats_id: 3,
        image_ids: [1, 5]
      },
    },
    users: {
      11: {
        id: 11,
        username: "pete_sag",
        first_name: "Peter",
        last_name: "Sagan",
        img_url: "http://peter_sagan.jpg",
        followers: 23,
        following: 23,
      }
      23: {
        id: 23,
        username: "craig89",
        first_name: "Craig",
        last_name: "Lockhart",
        img_url: "http://craigster.jpg",
        followers: 14,
        following: 15,
      },
      25: {
        id: 25,
        username: "lightning38",
        first_name: "Usain",
        last_name: "Bolt",
        img_url: "http://fastest_man_alive.jpg",
        followers: 32,
        following: 12,
      },
    },
    comments: {
      45: {
        id: 45,
        body: "Great run!",
        author_id: 34,
      }
      87: {
        id: 87,
        body: "I can't believe you climbed all those hills!!!",
        author_id: 43,
      },
      22: {
        id: 22,
        body: "Glad to see you back in the water",
        author_id: 88,
      },
    },
    stats: {
      67: {
        id: 67,
        activity_id: 45,
        route_id: 9,
        duration: 115,
        start: 12:48 PM,
        distance: 34,
        elevation: 1223,
        pace: 4:02,
        speed: 25.39,
        units: metric,
        type: ride,
      }
      89: {
        id: 89,
        activity_id: nil,
        route_id: 5,
        duration: nil,
        start: nil,
        distance: 34,
        elevation: 354,
        pace: nil,
        speed: nil,
        units: imperial,
        type: run,
      },
      93: {
        id: 93,
        activity_id: 3,
        route_id: nil,
        duration: 87,
        start: 12:09 PM,
        distance: 1.2,
        elevation: 0,
        pace: 22:34,
        speed: 2.01,
        units: imperial,
        type: swim,
      }
  },
  ui: {
    loading: true/false
  },
  errors: {
    login: ["Incorrect username/password combination"],
    signup: ["Username already exists"],
    NewRouteForm: ["Route title cannot be blank"],
    ActivityForm: [
      "Activity title cannot be blank",
      "Activity duration cannot be blank",
      "Activity start date cannot be blank",
      "Activity distance cannot be blank",
      "Activity elevation cannot be blank"
    ],
  },
  session: {
    id: 57,
    username: "pete_sag",
    img_url: "https://peter_sagan.jpg"
  }
}
Clone this wiki locally