Feature: add gitea widget (#2968)

This commit is contained in:
shamoon
2024-02-24 15:26:05 -08:00
parent 291bf422f9
commit fce694e2b9
8 changed files with 81 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
import { asJson } from "utils/proxy/api-helpers";
import genericProxyHandler from "utils/proxy/handlers/generic";
const widget = {
api: "{url}/api/v1/{endpoint}?access_token={key}",
proxyHandler: genericProxyHandler,
mappings: {
notifications: {
endpoint: "notifications",
},
issues: {
endpoint: "repos/issues/search",
map: (data) => ({
pulls: asJson(data).filter((issue) => issue.pull_request),
issues: asJson(data).filter((issue) => !issue.pull_request),
}),
},
},
};
export default widget;