mirror of
https://github.com/balzack/databag.git
synced 2025-02-15 13:09:17 +00:00
9 lines
327 B
JavaScript
9 lines
327 B
JavaScript
import { checkResponse, fetchWithTimeout } from './fetchUtil';
|
|
|
|
export async function getHandle(server, token, name) {
|
|
let available = await fetchWithTimeout(`https://${server}/account/username?agent=${token}&name=${encodeURIComponent(name)}`, { method: 'GET' })
|
|
checkResponse(available)
|
|
return await available.json()
|
|
}
|
|
|