From d0b8984d0e050eddcc5cb6019c86383dff15b426 Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 21 Sep 2023 17:19:20 +0900 Subject: [PATCH] fix: get latest version from the forked repo (close #54) --- packages/backend/package.json | 2 +- packages/backend/src/server/api/endpoints/latest-version.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index cbd442c85..8e40db2a4 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -4,7 +4,7 @@ "private": true, "type": "module", "scripts": { - "start": "pnpm node ./built/index.js", + "start": "pnpm node --dns-result-order=ipv4first ./built/index.js", "start:test": "NODE_ENV=test pnpm node ./built/index.js", "migrate": "pnpm run migrate:typeorm && pnpm run migrate:cargo", "migrate:typeorm": "typeorm migration:run -d ormconfig.js", diff --git a/packages/backend/src/server/api/endpoints/latest-version.ts b/packages/backend/src/server/api/endpoints/latest-version.ts index 4d07406d1..911ee8731 100644 --- a/packages/backend/src/server/api/endpoints/latest-version.ts +++ b/packages/backend/src/server/api/endpoints/latest-version.ts @@ -15,10 +15,12 @@ export const paramDef = { export default define(meta, paramDef, async () => { let tag_name; - await fetch("https://git.joinfirefish.org/api/v4/projects/7/releases") + await fetch( + "https://code.naskya.net/api/v1/repos/naskya/firefish/tags?page=1&limit=1", + ) .then((response) => response.json()) .then((data) => { - tag_name = data[0].tag_name; + tag_name = data[0].name; }); return {