Small Nest.js-based project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

17 lines
727 B

import movie1 from '../../../resources/movies/3532674.json';
import movie2 from '../../../resources/movies/5979300.json';
import movie3 from '../../../resources/movies/11043689.json';
import movie4 from '../../../resources/movies/11528860.json';
import type { StorageClient } from './types';
const movies = [movie1, movie2, movie3, movie4];
export const createStorageClient = (): StorageClient => {
return {
getMetadataByInternalId: async (internalId) =>
Promise.resolve(movies.find(({ id }) => id == internalId)),
getMetadataByImdbId: async (id) =>
Promise.resolve(movies.find(({ imdbId }) => imdbId == id)),
getAllMetadata: async () => Promise.resolve(movies),
};
};