( name: string, uid: string, )
| 290 | } |
| 291 | |
| 292 | export async function isNameAvailable( |
| 293 | name: string, |
| 294 | uid: string, |
| 295 | ): Promise<boolean> { |
| 296 | const user = await findByName(name); |
| 297 | // if the user found by name is the same as the user we are checking for, then the name is available |
| 298 | // this means that the user can update the casing of their name without it being taken |
| 299 | return user === undefined || user.uid === uid; |
| 300 | } |
| 301 | |
| 302 | export async function getUserByName( |
| 303 | name: string, |
no test coverage detected