Skip to content

Sample State

saphknight edited this page Mar 22, 2019 · 4 revisions

Sample State

{
    entities: {
        users: {
            1: {
                id: 1,
                username: "1337hax0r",
                user_image_url: "imgur.com/fakeimage",
                email: "1337hax0r@gmail.com",
                workspaceIds: [1],
                channelIds: [1,2],
                messageIds: [1,2]
            }
            2: {
                id: 2,
                username: "regularuser",
                user_image_url: "imgur.com/realimage",
                email: "firstnamelastname@gmail.com",
                workspaceIds: [1],
                channelIds: [1],
                messageIds: [3,4]
            }
            3: {
                id: 3,
                username: "hax0rstudent",
                user_image_url: "imgur.com/somewhatrealimage",
                email: "firstnameappname@gmail.com",
                workspaceIds: [1],
                channelIds: [1,2],
                messageIds: [5]
            }
        },
        workspaces: {
            1: {
                id: 1,
                name: "Application Institution",
                url: "application-institution.slack.com",
                userIds: [1,2],
                channelIds: [1,2]
            }
        },
        channels: {
            1: {
                id: 1, 
                name: "General",
                description: "Everybody talks!",
                direct_message?: false, 
                workspace_id: 1, 
                usersIds: [1,2,3],
                messageIds: [1,3,4]
            }
            2: {
                id: 2, 
                name: "Hax0rs 0n1y",
                description: "Only the hackiest of hax0rs!",
                direct_message?: true, 
                workspace_id: 1, 
                usersIds: [1,3],
                messageIds: [2,5]
            }
        },
        messages: {
            1: {
                id: 1,
                body: "Any hax0rs in here?",
                channel_id: 1,
                user_id: 1
            },
            2: {
                id: 2,
                body: "Not a hacker but a friendly joe schmo!",
                channel_id: 1,
                user_id: 2
            },
            3: {
                id: 3,
                body: "Hello? How come you're not talking anymore?",
                channel_id: 1,
                user_id: 2
            },
            4: {
                id: 4,
                body: "You seem like a hax0r, let me teach you some things",
                channel_id: 2,
                user_id: 1
            },
            5: {
                id: 5,
                body: "Application Institution teaches me more than you ever could!",
                channel_id: 2,
                user_id: 3
            }
        }
    },
    ui: {
        loading: false, 
        modal: modal 
    },
    errors: {
        login: ["Incorrect username or password"],
        channel: ["Channel description cannot be blank"]
    },
    session: {
        currentUserId: 2
    }
}
Clone this wiki locally