UNPKG

instantjob-recruiter-client

Version:

a set of tools for creating an instantjob recruiter react client

22 lines (18 loc) 722 B
import request from 'common/request' import store from 'common/store' import {store_shifts, replace_shift_events} from 'actions/shifts' export function action_create_shift(proposal_id, event_id) { return request.post(`mission_proposals/${proposal_id}/shifts`, {shift: {event_id}}) .then((shift) => { store.dispatch(store_shifts([shift])) return shift }) } export function action_update_shift_events({id}, events) { return request.put(`shifts/${id}/events`, {events}) .then((events) => store.dispatch(replace_shift_events(id, events))) } export function action_fetch_shifts(mission_id) { return request.get(`missions/${mission_id}/shifts`) .then((shifts) => store.dispatch(store_shifts(shifts))) }