@revoloo/cypress6
Version:
Cypress.io end to end testing tool
33 lines (25 loc) • 559 B
JavaScript
import _ from 'lodash'
import { observable, action } from 'mobx'
import Org from './organization-model'
export class Orgs {
orgs = []
error = null
isLoading = false
isLoaded = false
setOrgs (orgs) {
this.orgs = _.map(orgs, (org) => {
return (
new Org(org)
)
})
this.isLoading = false
this.isLoaded = true
}
setError (err) {
this.error = err
}
getOrgById (id) {
return _.find(this.orgs, { id })
}
}
export default new Orgs()