mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Rewrite login query
This commit is contained in:
20
src/utils/fetches/applicationFetch.ts
Normal file
20
src/utils/fetches/applicationFetch.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import client from '@api/client'
|
||||
|
||||
export const applicationFetch = async (
|
||||
key: string,
|
||||
{ instanceDomain, body }: { instanceDomain: string; body: FormData }
|
||||
) => {
|
||||
const formData = new FormData()
|
||||
formData.append('client_name', 'test_dudu')
|
||||
formData.append('redirect_uris', 'exp://127.0.0.1:19000')
|
||||
formData.append('scopes', 'read write follow push')
|
||||
|
||||
const res = await client({
|
||||
method: 'post',
|
||||
instance: 'remote',
|
||||
instanceDomain,
|
||||
url: `apps`,
|
||||
body: formData
|
||||
})
|
||||
return Promise.resolve(res.body)
|
||||
}
|
@ -2,12 +2,12 @@ import client from '@api/client'
|
||||
|
||||
export const instanceFetch = async (
|
||||
key: string,
|
||||
{ instance }: { instance: string }
|
||||
{ instanceDomain }: { instanceDomain: string }
|
||||
) => {
|
||||
const res = await client({
|
||||
method: 'get',
|
||||
instance: 'remote',
|
||||
instanceDomain: instance,
|
||||
instanceDomain,
|
||||
url: `instance`
|
||||
})
|
||||
return Promise.resolve(res.body)
|
||||
|
Reference in New Issue
Block a user