-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test task | Maksym Perekhodko | [email protected] #8
base: main
Are you sure you want to change the base?
Conversation
|
||
for (const profile of profiles) { | ||
const city = cities[Math.floor(Math.random() * cities.length)]; | ||
await queryInterface.bulkUpdate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was it required to update all profiles in the database?
|
||
@AllowNull(true) | ||
@Column | ||
city: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
field is nullable
@@ -19,11 +19,13 @@ export const RecruiterProfileSchema = gql` | |||
userId: Int! | |||
position: String! | |||
companyName: String! | |||
city: String! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
field is nullable in db but required in graphql schema, why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the catch! will fix in the next commit
GetAdminUserOptions, | ||
GetAdminUserResult, | ||
} from '@/modules/user/user.useCases/GetAdminUser.useCase'; | ||
GetAdminUserUseCaseOptions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these changes here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TS compilation have been failing due to missing GetAdminUserOptions and other imports
@@ -17,6 +19,7 @@ export const RecruiterProfileMeta = React.memo<Props>((props) => { | |||
className={cn(styles.recruiterMetaItem, typography.smallHeading)} | |||
key={item.name} | |||
> | |||
{item.name === RecruiterProfileMetaItems.City && <IconLocation />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if we need an icon for another item? can we somehow modify the incoming array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! will fix in the next commit
for (const profile of profiles) { | ||
const city = cities[Math.floor(Math.random() * cities.length)]; | ||
await queryInterface.bulkUpdate( | ||
'recruiter_profiles', | ||
{ city }, | ||
{ id: profile.id }, | ||
{ transaction: t } | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make a single request to the DB instead of profiles.length
requests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is better: single or multiple?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can generate a single query or just make a single bulkUpdate
request and this way make a single request to a database.
thanks for the notice! will fix in the next commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job
Unfortunately, I am currently unable to provide a video of the seeder work due to some hardware issues. I apologize for the inconvenience and will provide the video as soon as the problem is resolved. |
. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
@vkryvytskyy
Hi, I’m Maksym Perekhodko!
Here is my task solution:
According to the task, I've added a new nullable
city
column of typecharacter varying(255)
to therecruiter_profiles
table using Sequelize migrations. Updated theRecruiterProfile
model and GraphQL schema to include the newcity
field. Seeded the database with random Ukrainian city names for existing profiles. Modified the UI to display thecity
data in the recruiter profile view.Videos: