Skip to content

Instantly share code, notes, and snippets.

@herzzanu
Last active February 10, 2021 10:21
Show Gist options
  • Select an option

  • Save herzzanu/298df3e8ecda06e0fd8abb76b000f209 to your computer and use it in GitHub Desktop.

Select an option

Save herzzanu/298df3e8ecda06e0fd8abb76b000f209 to your computer and use it in GitHub Desktop.
Mirage config - using factories
// mirage/config.js - Mocking data using factories
this.post('/multi_transfers', function (schema, request) {
return server.create('multi-transfer', {
status: 'pending',
total_amount: 500,
transfers: [
{
amount: 300,
iban: 'FR3902854000000000000000024',
bic: 'BNPDFRP1',
name: 'Jane Doe',
},
{
amount: 200,
iban: 'FR1408672000000000000000167',
bic: 'BNPDFRP1',
name: 'John Doe',
},
],
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment