Skip to content

Commit

Permalink
add new request page
Browse files Browse the repository at this point in the history
  • Loading branch information
cohenaj194 committed Jun 13, 2024
1 parent d17f882 commit bbeb14b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions app/requests/GetBlog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { address, UserAgent } from '~/requests/client/config'

export interface BlogResponse {
itemID: number
itemDescription: string
}

export interface GetBlogProps {
itemId: number
}

const GetBlog: ({ itemId }: GetBlogProps) => Promise<Response> = async ({
itemId
}) => {
const requestBody = JSON.stringify({
item_id: itemId
})

console.log('Request body:', requestBody)

return fetch(`${address}/api/ffxiv/blog`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'User-Agent': UserAgent
},
body: requestBody
})
}

export default GetBlog

0 comments on commit bbeb14b

Please sign in to comment.