mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-20 23:12:51 +10:00
feat: add yarn typecheck and fix all types
This commit is contained in:
@@ -27,7 +27,7 @@ export default defineEventHandler(async (h3) => {
|
||||
take: parseInt(query.limit as string),
|
||||
skip: parseInt(query.skip as string),
|
||||
orderBy: orderBy,
|
||||
tags: tags?.map((e) => e.toString()),
|
||||
...(tags && { tags: tags.map((e) => e.toString()) }),
|
||||
search: query.search as string,
|
||||
};
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ export default defineEventHandler(async (h3) => {
|
||||
|
||||
tags: tags,
|
||||
|
||||
image: imageId,
|
||||
...(imageId && { image: imageId }),
|
||||
authorId: "system",
|
||||
});
|
||||
|
||||
|
||||
@@ -23,18 +23,9 @@ export default defineClientEventHandler(async (h3, {}) => {
|
||||
const mappedVersions = versions
|
||||
.map((version) => {
|
||||
if (!version.dropletManifest) return undefined;
|
||||
const manifest = JSON.parse(
|
||||
version.dropletManifest.toString()
|
||||
) as DropManifest;
|
||||
|
||||
/*
|
||||
TODO: size estimates
|
||||
They are a little complicated because of delta versions
|
||||
Manifests need to be generated with the manifest generator and then
|
||||
added up. I'm a little busy right now to implement this, though.
|
||||
*/
|
||||
|
||||
|
||||
const newVersion = { ...version, dropletManifest: undefined };
|
||||
// @ts-expect-error
|
||||
delete newVersion.dropletManifest;
|
||||
return {
|
||||
...newVersion,
|
||||
|
||||
@@ -23,18 +23,8 @@ export default defineClientEventHandler(async (h3, {}) => {
|
||||
const mappedVersions = versions
|
||||
.map((version) => {
|
||||
if (!version.dropletManifest) return undefined;
|
||||
const manifest = JSON.parse(
|
||||
version.dropletManifest.toString()
|
||||
) as DropManifest;
|
||||
|
||||
/*
|
||||
TODO: size estimates
|
||||
They are a little complicated because of delta versions
|
||||
Manifests need to be generated with the manifest generator and then
|
||||
added up. I'm a little busy right now to implement this, though.
|
||||
*/
|
||||
|
||||
const newVersion = { ...version, dropletManifest: undefined };
|
||||
// @ts-expect-error
|
||||
delete newVersion.dropletManifest;
|
||||
return {
|
||||
...newVersion,
|
||||
|
||||
@@ -20,7 +20,7 @@ export default defineClientEventHandler(async (h3) => {
|
||||
take: parseInt(query.limit as string),
|
||||
skip: parseInt(query.skip as string),
|
||||
orderBy: orderBy,
|
||||
tags: tags?.map((e) => e.toString()),
|
||||
...(tags && { tags: tags.map((e) => e.toString()) }),
|
||||
search: query.search as string,
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export default defineEventHandler(async (h3) => {
|
||||
take: parseInt(query.limit as string),
|
||||
skip: parseInt(query.skip as string),
|
||||
orderBy: orderBy,
|
||||
tags: tags?.map((e) => e.toString()),
|
||||
...(tags && { tags: tags.map((e) => e.toString()) }),
|
||||
search: query.search as string,
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class NewsManager {
|
||||
})),
|
||||
},
|
||||
|
||||
image: data.image,
|
||||
...(data.image && { image: data.image }),
|
||||
author: {
|
||||
connect: {
|
||||
id: data.authorId,
|
||||
|
||||
@@ -67,14 +67,14 @@ export class PriorityListIndexed<T> extends PriorityList<T> {
|
||||
return index as string;
|
||||
}
|
||||
|
||||
push(item: T, priority?: number): void {
|
||||
override push(item: T, priority?: number): void {
|
||||
const index = this.getIndex(item);
|
||||
this.indexMap[index] = item;
|
||||
|
||||
super.push(item, priority);
|
||||
}
|
||||
|
||||
pop(position?: number): PriorityTagged<T> {
|
||||
override pop(position?: number): PriorityTagged<T> {
|
||||
const value = super.pop(position);
|
||||
|
||||
const index = this.getIndex(value.object);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sessionHandler from "../internal/session";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
await sessionHandler.clearSession(h3);
|
||||
await sessionHandler.signout(h3);
|
||||
|
||||
return sendRedirect(h3, "/auth/signin");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user