some api routes
This commit is contained in:
parent
6591e0987f
commit
6e58f59274
39 changed files with 324 additions and 21 deletions
11
pages/api/user/border/@me.js
Normal file
11
pages/api/user/border/@me.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { getUserBorders } from "../../../../lib/borders";
|
||||
|
||||
export default function handler(req, res) {
|
||||
getUserBorders(req).then((result) => {
|
||||
if (result) {
|
||||
return res.status(200).json(result);
|
||||
} else {
|
||||
return res.status(404).json({ error: "Not Found" });
|
||||
}
|
||||
});
|
||||
}
|
11
pages/api/user/border/[id].js
Normal file
11
pages/api/user/border/[id].js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { getByDiscordId } from "../../../../lib/borders";
|
||||
|
||||
export default function handler(req, res) {
|
||||
const id = req.query.id;
|
||||
|
||||
getByDiscordId(id).then((result) => {
|
||||
const borderUrl = result ?? "0";
|
||||
|
||||
return res.status(200).send(borderUrl);
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue