diff --git a/components/RecurringVenueChip.vue b/components/RecurringVenueChip.vue new file mode 100644 index 0000000..9bb535d --- /dev/null +++ b/components/RecurringVenueChip.vue @@ -0,0 +1,48 @@ + + + diff --git a/components/RecurringVenueList.vue b/components/RecurringVenueList.vue new file mode 100644 index 0000000..bd5e505 --- /dev/null +++ b/components/RecurringVenueList.vue @@ -0,0 +1,33 @@ + + + diff --git a/components/RecurringVenueSearchCard.vue b/components/RecurringVenueSearchCard.vue new file mode 100644 index 0000000..24faa0c --- /dev/null +++ b/components/RecurringVenueSearchCard.vue @@ -0,0 +1,180 @@ + + + + + diff --git a/components/RecurringVenueShort.vue b/components/RecurringVenueShort.vue new file mode 100644 index 0000000..b29d858 --- /dev/null +++ b/components/RecurringVenueShort.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/components/SearchCard.vue b/components/SearchCard.vue index 676b912..3d593dc 100644 --- a/components/SearchCard.vue +++ b/components/SearchCard.vue @@ -233,7 +233,6 @@ + + \ No newline at end of file diff --git a/pages/venues.vue b/pages/venues.vue new file mode 100644 index 0000000..05bf06f --- /dev/null +++ b/pages/venues.vue @@ -0,0 +1,72 @@ + + + diff --git a/plugins/repository.js b/plugins/repository.js index df9c82f..a7e1cdb 100644 --- a/plugins/repository.js +++ b/plugins/repository.js @@ -63,6 +63,12 @@ export default (ctx, inject) => { // venues inject('venuesEndpoint', repositoryWithAxios('kg/' + 'venues')) + // Recurring Venues + inject('recurringVenuesEndpoint', repositoryWithAxios('kg/' + 'recurringvenues')) + + // Recurring Venue + inject('recurringVenueEndpoint', repositoryWithAxios('kg/' + 'recurringvenue')) + // licenses inject('licenseEndpoint', repositoryWithAxios('kg/' + 'licenses')) diff --git a/store/venues.js b/store/venues.js new file mode 100644 index 0000000..279dcd4 --- /dev/null +++ b/store/venues.js @@ -0,0 +1,91 @@ +export const state = () => ({ + recurringVenues: { + recurring_venues: [], + }, + currentVenue: {}, + artifacts: { + artifacts: [], + pages: 0, + total: 0 + }, + recurrenceId: null, + loading: false, + artifactsLoading: false +}) + +export const getters = { + recurringVenues: state => { + return state.recurringVenues + }, + currentVenue: state => { + return state.currentVenue + }, + loading: state => { + return state.loading + }, + artifactsLoading: state => { + return state.artifactsLoading + }, + artifacts: state => { + return state.artifacts + }, + recurrenceId: state => { + return state.recurrenceId + } +} + +export const mutations = { + SET_RECURRING_VENUES(state, recurringVenues) { + state.recurringVenues = recurringVenues + }, + RESET_RECURRING_VENUES(state) { + state.recurringVenues = { + recurring_venues: [], + } + }, + SET_LOADING(state, loading) { + state.loading = loading + }, + SET_ARTIFACTS_LOADING(state, loading) { + state.artifactsLoading = loading + }, + SET_ARTIFACTS(state, artifacts) { + state.artifacts = artifacts + }, + RESET_ARTIFACTS(state) { + state.artifacts = { + artifacts: [], + pages: 0, + total: 0 + } + }, + SET_RECURRENCE_ID(state, recurrenceId) { + state.recurrenceId = recurrenceId + }, + SET_CURRENT_VENUE(state, currentVenue) { + state.currentVenue = currentVenue + } +} + +export const actions = { + async fetchRecurringVenues({ commit, state }) { + commit('SET_LOADING', true) + let payload = { + all_recurring_venues: true, + verified: true, + } + let response = await this.$recurringVenuesEndpoint.index(payload) + if (typeof response !== 'undefined') { + commit('SET_RECURRING_VENUES', response) + } + commit('SET_LOADING', false) + }, + async fetchArtifacts({ commit, state }, payload) { + commit('SET_ARTIFACTS_LOADING', true) + let response = await this.$artifactSearchEndpoint.index(payload) + if (typeof response !== 'undefined') { + commit('SET_ARTIFACTS', response) + } + commit('SET_ARTIFACTS_LOADING', false) + }, +}