hippofish/packages/backend/src/server/api/endpoints/latest-version.ts
ThatOneCalculator 6da5a5b89b
find and replace
2023-07-02 15:18:30 -07:00

29 lines
564 B
TypeScript

import define from "../define.js";
export const meta = {
tags: ["meta"],
requireCredential: false,
requireCredentialPrivateMode: true,
} as const;
export const paramDef = {
type: "object",
properties: {},
required: [],
} as const;
export default define(meta, paramDef, async () => {
let tag_name;
await fetch(
"https://codeberg.org/api/v1/repos/firefish/firefish/releases?draft=false&pre-release=false&page=1&limit=1",
)
.then((response) => response.json())
.then((data) => {
tag_name = data[0].tag_name;
});
return {
tag_name,
};
});