Skip to content
This repository was archived by the owner on Dec 9, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/environments/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
export default function(baseApi) {
return {
api: {
shows: `${baseApi}/shows/{showId}`,
episodes: `${baseApi}/shows/{showId}/episodes`,
cast: `${baseApi}/shows/{showId}/cast`,
shows: `${baseApi}/shows/:showId`,
episodes: `${baseApi}/shows/:showId/episodes`,
cast: `${baseApi}/shows/:showId/cast`,
},
isProduction: true,
isDevelopment: false,
Expand Down
6 changes: 3 additions & 3 deletions src/stores/shows/ShowsEffect.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import EffectUtility from '../../utilities/EffectUtility';

export default class ShowsEffect {
static async requestShow(showId) {
const endpoint = environment.api.shows.replace('{showId}', showId);
const endpoint = environment.api.shows.replace(':showId', showId);

return EffectUtility.getToModel(ShowModel, endpoint);
}

static async requestEpisodes(showId) {
const endpoint = environment.api.episodes.replace('{showId}', showId);
const endpoint = environment.api.episodes.replace(':showId', showId);

return EffectUtility.getToModel(EpisodeModel, endpoint);
}

static async requestCast(showId) {
const endpoint = environment.api.cast.replace('{showId}', showId);
const endpoint = environment.api.cast.replace(':showId', showId);

// Below is just to show you what the above "requestEpisodes" method is doing with "HttpUtility.getToModel".
// In your application you can change this to match the "requestEpisodes" method.
Expand Down