Files
2026-07-26 18:25:37 +09:00

15 lines
438 B
JavaScript

import config from "../../../config/index.js";
export default ((object, user)=>{
if (object == null) return null;
const id = typeof object.id === "string" && object.id.startsWith(config.url) ? `${object.id}/undo` : undefined;
return {
type: "Undo",
...id ? {
id
} : {},
actor: `${config.url}/users/${user.id}`,
object,
published: new Date().toISOString()
};
});