You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
748 B
21 lines
748 B
import { listExportTasksByUser } from "#server/service/export/jobs";
|
|
import { R } from "#server/utils/response";
|
|
|
|
export default defineWrappedResponseHandler(async (event) => {
|
|
const user = await event.context.auth.requireUser();
|
|
const tasks = await listExportTasksByUser(user.id);
|
|
return R.success({
|
|
items: tasks.map((task) => ({
|
|
id: task.id,
|
|
status: task.status,
|
|
maskPolicy: task.maskPolicy,
|
|
outputName: task.outputName,
|
|
totalBytes: task.totalBytes,
|
|
errorCode: task.errorCode,
|
|
errorMessage: task.errorMessage,
|
|
createdAt: task.createdAt.toISOString(),
|
|
updatedAt: task.updatedAt.toISOString(),
|
|
expiresAt: task.expiresAt ? task.expiresAt.toISOString() : null,
|
|
})),
|
|
});
|
|
});
|
|
|