Skip to content

Sample State

Brice Powell edited this page Dec 28, 2017 · 6 revisions
{
  entities: {
    workouts: {
      1:  {
        id: 1,
        title: "60th to Wall Street via Broadway",
        description: "Traffic juke",
        duration: "00:35:00",
        speed: 15.1,
        user_id: 3,
        route_id: 1,
        created_at: "Fri, 10 January 2018 12:16:08"
      },
      2:  {
        id: 2,
        title: "Central Park Laps",
        description: "Snow day, burrrrrrrrrrr",
        duration: "4:13:20",
        speed: 18.3,
        user_id: 2,
        route_id: 2,
        created_at: "Mon, 1 January 2017 09:39:47"
      },
      3:  {
        id: 3,
        title: "Williamsburg Bridge Jog(both ways)",
        description: "Chilly morning, good for the lungs",
        duration: "00:42:35",
        speed: 1.8,
        user_id: 25,
        route_id: 1,
        created_at: "Fri, 13 October 2017 14:56:12"
      }
    },
    routes: {
      1:  {
        id: 1,
        title: "Broadway Route",
        start_point: "40.767806, -73.9818638",
        end_point: "40.707730, -74.011585",
        type: "ride",
        user_id: 11,
        distance: 36.7,
        elevation: 2011,
        estimated-duration: 370
      },
      2:  {
        id: 2,
        title: "Loop around the woods",
        start_point: "40.767187, -73.977145",
        end_point: "40.767187, -73.977145",
        type: "ride",
        user_id: 23,
        distance: 7.6,
        elevation: 430,
        estimated-duration: 54
      },
      3:  {
        id: 3,
        title: "Brooklyn to LES",
        start_point: "40.767806, -73.981863",
        end_point: "40.710476, -73.961086",
        type: "run"
        user_id: 25,
        distance: 8.7,
        elevation: 279,
        estimated-duration: 60
      }
    },
  users: {
    1:  {
      name: 'Joe Slow',
      height: 6.1,
      weight: 197,
      workout_ids: [3, 1, 2],
      route_ids: [2, 4],
    },
    2:  {
      name: 'Michelle Baller',
      height: 5.4,
      weight: 115,
      workout_ids: [3, 1, 2],
      route_ids: [3, 7],
    },
    3:  {
      name: 'Tay Swift',
      height: 5.6,
      weight: 125,
      workout_ids: [3, 1, 2],
      route_ids: [1, 8],
    },
  }
  session: {
          id: 2
         },
     ui: {
   errors: {
         sessionErrors: ['Incorrect username or password'],
         workoutErrors: ['Some fields cannot be left blank'],
           routeErrors: ['Invalid route']
           }
         }
}

Clone this wiki locally