mirror of
https://github.com/outline/outline.git
synced 2026-11-24 23:00:18 +03:00
24 lines
614 B
TypeScript
24 lines
614 B
TypeScript
import path from "node:path";
|
|
import type { FileOperation } from "@server/models";
|
|
import { presentUser } from ".";
|
|
|
|
export default function presentFileOperation(data: FileOperation) {
|
|
return {
|
|
id: data.id,
|
|
type: data.type,
|
|
format: data.format,
|
|
name:
|
|
data.collection?.name ||
|
|
data.document?.displayTitle ||
|
|
path.basename(data.key || ""),
|
|
state: data.state,
|
|
error: data.error,
|
|
size: data.size,
|
|
collectionId: data.collectionId,
|
|
documentId: data.documentId,
|
|
user: presentUser(data.user),
|
|
createdAt: data.createdAt,
|
|
updatedAt: data.updatedAt,
|
|
};
|
|
}
|