remove more ternaries
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { prisma } from "@/lib/api/db";
|
||||
import { Backup } from "@/types/global";
|
||||
import createFolder from "@/lib/api/storage/createFolder";
|
||||
|
||||
const MAX_LINKS_PER_USER = Number(process.env.MAX_LINKS_PER_USER) || 30000;
|
||||
@@ -85,23 +84,23 @@ export default async function importFromWallabag(
|
||||
tags:
|
||||
link.tags && link.tags[0]
|
||||
? {
|
||||
connectOrCreate: link.tags.map((tag) => ({
|
||||
where: {
|
||||
name_ownerId: {
|
||||
name: tag.trim(),
|
||||
ownerId: userId,
|
||||
},
|
||||
},
|
||||
create: {
|
||||
connectOrCreate: link.tags.map((tag) => ({
|
||||
where: {
|
||||
name_ownerId: {
|
||||
name: tag.trim(),
|
||||
owner: {
|
||||
connect: {
|
||||
id: userId,
|
||||
},
|
||||
ownerId: userId,
|
||||
},
|
||||
},
|
||||
create: {
|
||||
name: tag.trim(),
|
||||
owner: {
|
||||
connect: {
|
||||
id: userId,
|
||||
},
|
||||
},
|
||||
})),
|
||||
}
|
||||
},
|
||||
})),
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ export default async function moveFile(from: string, to: string) {
|
||||
};
|
||||
|
||||
try {
|
||||
s3Client.copyObject(copyParams, async (err: any) => {
|
||||
s3Client.copyObject(copyParams, async (err: unknown) => {
|
||||
if (err) {
|
||||
console.error("Error copying the object:", err);
|
||||
} else {
|
||||
|
||||
@@ -28,10 +28,10 @@ export default async function readFile(filePath: string) {
|
||||
try {
|
||||
let returnObject:
|
||||
| {
|
||||
file: Buffer | string;
|
||||
contentType: ReturnContentTypes;
|
||||
status: number;
|
||||
}
|
||||
file: Buffer | string;
|
||||
contentType: ReturnContentTypes;
|
||||
status: number;
|
||||
}
|
||||
| undefined;
|
||||
|
||||
const headObjectAsync = util.promisify(
|
||||
|
||||
Reference in New Issue
Block a user