Skip to content

Commit

Permalink
Faker Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Guhapriya01 committed Apr 1, 2024
1 parent 88dd115 commit 671fe06
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# my-app
# LMS

This README outlines the details of collaborating on this Ember application.
A short introduction of this app could easily go here.
Expand Down
7 changes: 4 additions & 3 deletions mirage/factories/book.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Factory } from 'miragejs';
import { faker } from '@faker-js/faker';

export default Factory.extend({
name:(i)=>`Book ${i}`,
author: (i)=>`Author ${i}`,
publisher: (i)=>`Publisher ${i}`,
name:(i)=>`Book ${i+1}`,
author: ()=>faker.person.firstName(),
publisher: (i)=>`Publisher ${i+1}`,
publishedDate: "2004-04-11",
});
5 changes: 3 additions & 2 deletions mirage/factories/library.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Factory ,association} from 'miragejs';
import { faker } from '@faker-js/faker';

export default Factory.extend({
name: (i) => `Library ${i}`,
location: (i) => `Location ${i}`,
name: (i) => `Library ${i+1}`,
location: () => faker.location.city(),
timing: "10.00 am TO 5.00 pm",
afterCreate(library, server) {
library.update({
Expand Down
23 changes: 23 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@ember/optional-features": "^2.1.0",
"@ember/string": "^3.1.1",
"@ember/test-helpers": "^3.3.0",
"@faker-js/faker": "^8.4.1",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"broccoli-asset-rev": "^3.0.0",
Expand Down

0 comments on commit 671fe06

Please sign in to comment.