mirror of
https://github.com/outline/outline.git
synced 2026-12-04 18:34:54 +03:00
Add collections.move event
This commit is contained in:
1 parent
6ac39dbe55
commit
06c285bad2
3 files changed
+12
-1
No files matched your search
@@ -658,6 +658,8 @@ router.post("collections.move", auth(), async (ctx) => {
|
||||
const collection = await Collection.findByPk(id);
|
||||
authorize(user, "move", collection);
|
||||
|
||||
const previousIndex = collection.index;
|
||||
|
||||
await collection.update({ index });
|
||||
|
||||
removeIndexCollisions(user.teamId);
|
||||
@@ -667,7 +669,7 @@ router.post("collections.move", auth(), async (ctx) => {
|
||||
collectionId: collection.id,
|
||||
teamId: collection.teamId,
|
||||
actorId: user.id,
|
||||
data: { name: collection.name },
|
||||
data: { previousIndex, currentIndex: collection.index },
|
||||
ip: ctx.request.ip,
|
||||
});
|
||||
|
||||
|
||||
@@ -135,6 +135,14 @@ export type CollectionEvent =
|
||||
actorId: string,
|
||||
data: { name: string, groupId: string },
|
||||
ip: string,
|
||||
}
|
||||
| {
|
||||
name: "collections.move",
|
||||
collectionId: string,
|
||||
teamId: string,
|
||||
actorId: string,
|
||||
data: { previousIndex: string, currentIndex: string },
|
||||
ip: string,
|
||||
};
|
||||
|
||||
export type GroupEvent =
|
||||
|
||||
@@ -73,6 +73,7 @@ Event.AUDIT_EVENTS = [
|
||||
"api_keys.delete",
|
||||
"collections.create",
|
||||
"collections.update",
|
||||
"collections.move",
|
||||
"collections.add_user",
|
||||
"collections.remove_user",
|
||||
"collections.add_group",
|
||||
|
||||
Reference in new issue
Block a user