Skip to content

Commit 2ed24b2

Browse files
authored
Merge pull request codeBelt#11 from codeBelt/change/endpoints-express-style
Change endpoint replace string format to match express
2 parents d78bffe + 4fcd835 commit 2ed24b2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/environments/base.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
export default function(baseApi) {
77
return {
88
api: {
9-
shows: `${baseApi}/shows/{showId}`,
10-
episodes: `${baseApi}/shows/{showId}/episodes`,
11-
cast: `${baseApi}/shows/{showId}/cast`,
9+
shows: `${baseApi}/shows/:showId`,
10+
episodes: `${baseApi}/shows/:showId/episodes`,
11+
cast: `${baseApi}/shows/:showId/cast`,
1212
},
1313
isProduction: true,
1414
isDevelopment: false,

src/stores/shows/ShowsEffect.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ import EffectUtility from '../../utilities/EffectUtility';
88

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

1313
return EffectUtility.getToModel(ShowModel, endpoint);
1414
}
1515

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

1919
return EffectUtility.getToModel(EpisodeModel, endpoint);
2020
}
2121

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

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

0 commit comments

Comments
 (0)