Skip to content
Snippets Groups Projects

Resolve "Add routes and template for Presentation view"

Merged Albin Henriksson requested to merge 54-add-routes-and-template-for-presentation-view into dev
25 files
+ 651
40
Compare changes
  • Side-by-side
  • Inline
Files
25
+ 44
0
import axios from 'axios'
import { Slide } from '../interfaces/Slide'
import { AppDispatch } from './../store'
import Types from './types'
export const getPresentationCompetition = (id: string) => async (dispatch: AppDispatch) => {
await axios
.get(`/competitions/${id}`)
.then((res) => {
dispatch({
type: Types.SET_PRESENTATION_COMPETITION,
payload: res.data,
})
})
.catch((err) => {
console.log(err)
})
}
export const getPresentationTeams = (id: string) => async (dispatch: AppDispatch) => {
await axios
.get(`/competitions/${id}/teams`)
.then((res) => {
dispatch({
type: Types.SET_PRESENTATION_TEAMS,
payload: res.data.items,
})
})
.catch((err) => {
console.log(err)
})
}
export const setCurrentSlide = (slide: Slide) => (dispatch: AppDispatch) => {
dispatch({ type: Types.SET_PRESENTATION_SLIDE, payload: slide })
}
export const setCurrentSlidePrevious = () => (dispatch: AppDispatch) => {
dispatch({ type: Types.SET_PRESENTATION_SLIDE_PREVIOUS })
}
export const setCurrentSlideNext = () => (dispatch: AppDispatch) => {
dispatch({ type: Types.SET_PRESENTATION_SLIDE_NEXT })
}
Loading