Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
8d1b061b
Commit
8d1b061b
authored
Aug 10, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move api helpers outside of page folder
parent
ec28e167
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
7 additions
and
7 deletions
+7
-7
fetch.ts
lib/api/fetch.ts
+0
-0
handler.ts
lib/api/handler.ts
+1
-1
[id].ts
pages/api/account/api-keys/[id].ts
+1
-1
index.ts
pages/api/account/api-keys/index.ts
+1
-1
[id].ts
pages/api/account/private-tags/address/[id].ts
+1
-1
index.ts
pages/api/account/private-tags/address/index.ts
+1
-1
[id].ts
pages/api/account/private-tags/transaction/[id].ts
+1
-1
index.ts
pages/api/account/private-tags/transaction/index.ts
+1
-1
No files found.
pages/api/utils
/fetch.ts
→
lib/api
/fetch.ts
View file @
8d1b061b
File moved
pages/api/utils
/handler.ts
→
lib/api
/handler.ts
View file @
8d1b061b
import
type
{
NextApiRequest
,
NextApiResponse
}
from
'
next
'
;
import
fetch
from
'
.
/fetch
'
;
import
fetch
from
'
lib/api
/fetch
'
;
type
Methods
=
'
GET
'
|
'
POST
'
|
'
PUT
'
|
'
DELETE
'
;
...
...
pages/api/account/api-keys/[id].ts
View file @
8d1b061b
import
type
{
NextApiRequest
}
from
'
next
'
;
import
handler
from
'
pages/api/utils
/handler
'
;
import
handler
from
'
lib/api
/handler
'
;
const
getUrl
=
(
req
:
NextApiRequest
)
=>
{
return
`/account/v1/user/api_keys/
${
req
.
query
.
id
}
`
;
...
...
pages/api/account/api-keys/index.ts
View file @
8d1b061b
import
type
{
ApiKeys
}
from
'
types/api/account
'
;
import
handler
from
'
pages/api/utils
/handler
'
;
import
handler
from
'
lib/api
/handler
'
;
const
apiKeysHandler
=
handler
<
ApiKeys
>
(()
=>
'
/account/v1/user/api_keys
'
,
[
'
GET
'
,
'
POST
'
]);
...
...
pages/api/account/private-tags/address/[id].ts
View file @
8d1b061b
import
type
{
NextApiRequest
}
from
'
next
'
;
import
handler
from
'
pages/api/utils
/handler
'
;
import
handler
from
'
lib/api
/handler
'
;
const
getUrl
=
(
req
:
NextApiRequest
)
=>
{
return
`/account/v1/user/tags/address/
${
req
.
query
.
id
}
`
;
...
...
pages/api/account/private-tags/address/index.ts
View file @
8d1b061b
import
type
{
AddressTags
}
from
'
types/api/account
'
;
import
handler
from
'
pages/api/utils
/handler
'
;
import
handler
from
'
lib/api
/handler
'
;
const
addressHandler
=
handler
<
AddressTags
>
(()
=>
'
/account/v1/user/tags/address
'
,
[
'
GET
'
,
'
POST
'
]);
...
...
pages/api/account/private-tags/transaction/[id].ts
View file @
8d1b061b
import
type
{
NextApiRequest
}
from
'
next
'
;
import
handler
from
'
pages/api/utils
/handler
'
;
import
handler
from
'
lib/api
/handler
'
;
const
getUrl
=
(
req
:
NextApiRequest
)
=>
{
return
`/account/v1/user/tags/transaction/
${
req
.
query
.
id
}
`
;
...
...
pages/api/account/private-tags/transaction/index.ts
View file @
8d1b061b
import
type
{
TransactionTags
}
from
'
types/api/account
'
;
import
handler
from
'
pages/api/utils
/handler
'
;
import
handler
from
'
lib/api
/handler
'
;
const
transactionHandler
=
handler
<
TransactionTags
>
(()
=>
'
/account/v1/user/tags/transaction
'
,
[
'
GET
'
,
'
POST
'
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment