Skip to content

Commit

Permalink
Tidy fixture domain api
Browse files Browse the repository at this point in the history
  • Loading branch information
rwalle61 committed Mar 24, 2021
1 parent 21c8158 commit 365438a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/domain/fixture/api/adapter/bingoal.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import makeRequest from '../../../../services/request';
import { GetFixtures, GetFixture } from '../indexBackend';

export const getFixturesFromBingoal: GetFixtures = async () =>
export const getFixtures: GetFixtures = async () =>
makeRequest({
method: 'get',
url: `${window.location.origin}/api/fixtures`,
});

export const getFixtureFromBingoal: GetFixture = async (id: string) =>
export const getFixture: GetFixture = async (id: string) =>
makeRequest({
method: 'get',
url: `${window.location.origin}/api/fixtures/${id}`,
Expand Down
9 changes: 3 additions & 6 deletions src/domain/fixture/api/indexFrontend.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import FixturePreview from '../data/FixturePreview';
import Fixture from '../data/Fixture';
import { GetFixture, GetFixtures } from './indexBackend';
import {
getFixturesFromBingoal,
getFixtureFromBingoal,
getFixtures as getFixturesFromBingoal,
getFixture as getFixtureFromBingoal,
} from './adapter/bingoal';

export type GetFixtures = () => Promise<FixturePreview[]>;
export const getFixtures: GetFixtures = getFixturesFromBingoal;

export type GetFixture = (id: string) => Promise<Fixture>;
export const getFixture: GetFixture = getFixtureFromBingoal;

0 comments on commit 365438a

Please sign in to comment.