Skip to content
Snippets Groups Projects
Unverified Commit ba9563b9 authored by MeiMei's avatar MeiMei Committed by GitHub
Browse files

Use unique id for Undo (#8434)

parent 9320c169
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,11 @@ import { ILocalUser, User } from '@/models/entities/user.js';
export default (object: any, user: { id: User['id'] }) => {
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(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment