fix: Deleted collections not showing in audit log
feat: Show titles of objects in audit log fix: modelId not saved with share events fix: List item squashes avatar at small screen sizes
This commit is contained in:
@@ -12,11 +12,12 @@ const { authorize } = policy;
|
||||
const router = new Router();
|
||||
|
||||
router.post('events.list', auth(), pagination(), async ctx => {
|
||||
let { sort = 'updatedAt', direction, auditLog = false } = ctx.body;
|
||||
let { sort = 'createdAt', direction, auditLog = false } = ctx.body;
|
||||
if (direction !== 'ASC') direction = 'DESC';
|
||||
|
||||
const user = ctx.state.user;
|
||||
const collectionIds = await user.collectionIds();
|
||||
const paranoid = false;
|
||||
const collectionIds = await user.collectionIds(paranoid);
|
||||
|
||||
let where = {
|
||||
name: Event.ACTIVITY_EVENTS,
|
||||
|
||||
@@ -8,6 +8,7 @@ const Event = sequelize.define('event', {
|
||||
defaultValue: DataTypes.UUIDV4,
|
||||
primaryKey: true,
|
||||
},
|
||||
modelId: DataTypes.UUID,
|
||||
name: DataTypes.STRING,
|
||||
ip: DataTypes.STRING,
|
||||
data: DataTypes.JSONB,
|
||||
|
||||
@@ -54,7 +54,7 @@ User.associate = models => {
|
||||
};
|
||||
|
||||
// Instance methods
|
||||
User.prototype.collectionIds = async function() {
|
||||
User.prototype.collectionIds = async function(paranoid: boolean = true) {
|
||||
let models = await Collection.findAll({
|
||||
attributes: ['id', 'private'],
|
||||
where: { teamId: this.teamId },
|
||||
@@ -67,6 +67,7 @@ User.prototype.collectionIds = async function() {
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
paranoid,
|
||||
});
|
||||
|
||||
// Filter collections that are private and don't have an association
|
||||
|
||||
Reference in New Issue
Block a user