feat: get home feed in server side
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { NextServerResponse, getQuery } from "~/lib/server-helper"
|
||||
import { getFeed } from "~/models/home.model"
|
||||
|
||||
export async function GET(req: Request) {
|
||||
const query = getQuery(req)
|
||||
|
||||
const result = await getFeed({
|
||||
type: query.type,
|
||||
cursor: query.cursor,
|
||||
limit: +query.limit || undefined,
|
||||
characterId: +query.characterId || undefined,
|
||||
daysInterval: +query.daysInterval || undefined,
|
||||
searchKeyword: query.searchKeyword,
|
||||
searchType: query.searchType,
|
||||
tag: query.tag,
|
||||
useHTML: false,
|
||||
topic: query.topic,
|
||||
})
|
||||
const res = new NextServerResponse()
|
||||
return res.status(200).json(result)
|
||||
}
|
||||
Reference in New Issue
Block a user