Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
feat: add [username] to the path
Browse files Browse the repository at this point in the history
  • Loading branch information
pupixipup committed Feb 6, 2024
1 parent a693d7a commit 5027de5
Show file tree
Hide file tree
Showing 20 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useGetMe } from '@/entities/session';
import { Card } from './card';
import { Star, Cake, MapPin, UserIcon } from '@/shared/assets';
import { Row } from '@/app/(main)/profile/ui/row';
import { Row } from '@/app/(main)/[username]/profile/ui/row';
import { Flex } from '@/shared/ui';
import { calculateAge } from '@/shared/lib';

Expand Down
2 changes: 1 addition & 1 deletion client/src/entities/session/api/useGithub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const useGithub = () => {
localStorage.setItem('token', data.data.token);
Cookies.set('refreshToken', data.data.refreshToken);
/*
* If user has username it means he already signed up, so we don't need to
* If user has [username] it means he already signed up, so we don't need to
* redirect him to onboarding, otherwise we should.
* */
if (user.username) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/entities/session/api/useGoogle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const useGoogle = () => {
localStorage.setItem('token', data.data.token);
Cookies.set('refreshToken', data.data.refreshToken);
/*
* If user has username it means he already signed up, so we don't need to
* If user has [username] it means he already signed up, so we don't need to
* redirect him to onboarding, otherwise we should.
* */
if (user.username) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/entities/session/api/useLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const useLogin = () => {
localStorage.setItem('token', data.data.token);
Cookies.set('refreshToken', data.data.refreshToken);
/*
* If user has username it means he already signed up, so we don't need to
* If user has [username] it means he already signed up, so we don't need to
* redirect him to onboarding, otherwise we should.
* */
if (user.username) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/shared/ui/input/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import styles from './input.module.scss';
* To access the underlying input element directly:
* ```tsx
* const inputRef = useRef<HTMLInputElement>(null);
* <Input ref={inputRef} name="username" label="Username" />
* <Input ref={inputRef} name="[username]" label="Username" />
* ```
*
*/
Expand Down
4 changes: 2 additions & 2 deletions client/src/widgets/modals/info-modal/team/phone/phone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
// <Flex direction='column' gap='4px'>
// <Flex gap='4px' align='center'>
// <Typography size='body_m' color='white'>
// {team?.leader?.username}
// {team?.leader?.[username]}
// </Typography>
// <ImageLoader
// width={16}
Expand All @@ -128,7 +128,7 @@
// />
// <Flex direction='column' gap='4px'>
// <Flex gap='4px' align='center'>
// <Typography size='body_m'>{teammate?.username}</Typography>
// <Typography size='body_m'>{teammate?.[username]}</Typography>
// <ImageLoader
// width={16}
// height={10}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface UserData {

export interface SidebarProfileProps {
/**
* Determines the visual state of the user's real name and username. If true, they are highlighted.
* Determines the visual state of the user's real name and [username]. If true, they are highlighted.
*/
active: boolean;
/**
Expand All @@ -34,7 +34,7 @@ export interface SidebarProfileProps {

/**
* The SidebarProfile component displays the user's profile information in the sidebar.
* It shows the user's image, real name, and username. If the user is not registered, default data is shown.
* It shows the user's image, real name, and [username]. If the user is not registered, default data is shown.
*
* Example of usage:
*
Expand All @@ -45,7 +45,7 @@ export interface SidebarProfileProps {
* const user = new User({
* isRegistered: true,
* fullName: 'John Doe',
* username: 'john.doe',
* [username]: 'john.doe',
* image: '/images/user/john.png'
* });
*
Expand Down
4 changes: 2 additions & 2 deletions server/test/user/users.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Get users (e2e)', () => {
});
});

it('Register new user with username for tests: /api/v1/auth/email/register (POST)', async () => {
it('Register new user with [username] for tests: /api/v1/auth/email/register (POST)', async () => {
const email = faker.internet.email();
await request(app)
.post('/api/v1/auth/email/register')
Expand Down Expand Up @@ -261,7 +261,7 @@ describe('Get users (e2e)', () => {
});
});

it('Get users with username filter: /api/v1/users?filters= (GET)', () => {
it('Get users with [username] filter: /api/v1/users?filters= (GET)', () => {
return request(app)
.get(`/api/v1/users?filters={"username": "${username}"}`)
.expect(200)
Expand Down

0 comments on commit 5027de5

Please sign in to comment.