Added user points indicator

This commit is contained in:
2023-07-27 12:53:27 +03:00
parent abe3e64883
commit e60d5d6732
6 changed files with 32 additions and 20 deletions

View File

@ -8,10 +8,12 @@ const initialUser: User = import.meta.env.DEV ? { // Temporary, until api is rea
id: Math.random() * 100,
name: faker.person.firstName() + ' ' + faker.person.lastName(),
regDate: faker.date.anytime().getTime(),
points: Math.round(Math.random() * 1000),
} : {
id: -1,
name: '',
regDate: 0,
points: 0,
}
const composeUserURL = () => (

View File

@ -4,6 +4,7 @@ type User = {
id: number,
name: string,
regDate: number,
points: number
}
const isUser = (obj: unknown): obj is User => (
@ -11,6 +12,7 @@ const isUser = (obj: unknown): obj is User => (
'id': 'number',
'name': 'string',
'regDate': 'number',
'points': 'number',
})
)