Skip to content

Commit

Permalink
Merge pull request #59 from dscdut/fix/safe-alert-api
Browse files Browse the repository at this point in the history
fix: file-index-api
  • Loading branch information
ThuongHoai081 authored Mar 14, 2024
2 parents c2fc566 + 5e2ea63 commit 0716340
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion backend/src/core/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const ModuleResolver = HandlerResolver.builder()
MediaResolver,
HelpSignalResolver,
EmergencyResolver,
RelativeResolver
RelativeResolver,
CommentResolver,
UserReactResolver,
ContactResolver,
Expand Down
6 changes: 3 additions & 3 deletions backend/src/core/database/seeds/04-posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ const tableName = 'posts';
exports.seed = async knex => {
await knex(tableName).del();

const topics = ["Food", "Accommodation", "Other"];
const locations = ["130 Dien Bien Phu, Thanh Khe, Da Nang", "132 Nguyen Luong Bang, Lien Chieu, Da Nang", "44 Ho Tuong, Thanh Khe, Da Nang"];
const posts = Array.from({ length: numUsers }, (_, index) => ({
const topics = ['Food', 'Accommodation', 'Other'];
const locations = ['130 Dien Bien Phu, Thanh Khe, Da Nang', '132 Nguyen Luong Bang, Lien Chieu, Da Nang', '44 Ho Tuong, Thanh Khe, Da Nang'];
const posts = Array.from({ length: numUsers }, () => ({
topic: topics[fakerVI.number.int({ min: 0, max: topics.length - 1 })],
location: locations[fakerVI.number.int({ min: 0, max: locations.length - 1 })],
content: fakerVI.lorem.sentence(),
Expand Down
6 changes: 3 additions & 3 deletions backend/src/core/database/seeds/07-contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ exports.seed = async knex => {
'Motorbike repair team'];
const lengthArr = rescueGroups.length;

const contacts = Array.from({ length: numContacts }, (_, index) => {
const contacts = Array.from({ length: numContacts }, () => {
const numRD = Math.floor(Math.random() * lengthArr) + 1;
return {
group_name: rescueGroups[numRD - 1],
phone_number: '0' + fakerVI.string.numeric({ length: 9 }),
phone_number: `0${ fakerVI.string.numeric({ length: 9 })}`,
address: fakerVI.location.streetAddress(),
details: fakerVI.lorem.sentence(),
latitude: fakerVI.location.latitude(),
longitude: fakerVI.location.longitude(),
emergency_id: numRD,
}
};
});

await knex(tableName).insert(contacts);
Expand Down

0 comments on commit 0716340

Please sign in to comment.