mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-31 18:08:17 -05:00
* Fetch user from server, set locale in realm and change language with i18next * Added some Spanish translations so I can see localization working * config QueryClient with `cacheTime: Infinity` to deal with "Jest did not exit" errors Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
23 lines
685 B
JavaScript
23 lines
685 B
JavaScript
import factory from "factoria";
|
|
import fs from "fs";
|
|
import path from "path";
|
|
|
|
// Require each individual factory definition, not to use the export but just
|
|
// to register them with factoria
|
|
const pathToFactories = path.join( __dirname, "factories" );
|
|
fs.readdirSync( pathToFactories ).forEach( file => {
|
|
const factoryName = path.basename( file, ".js" );
|
|
// eslint-disable-next-line global-require, import/no-dynamic-require
|
|
require( `./factories/${factoryName}` );
|
|
} );
|
|
|
|
// Makes a basic API response from an array of results
|
|
export const makeResponse = ( results = [] ) => ( {
|
|
total_results: results.length,
|
|
page: 1,
|
|
per_page: 30,
|
|
results
|
|
} );
|
|
|
|
export default factory;
|