tududi/backend/models/action.js
antanst b8611d9338 chore(lint): remove unnecessary try/catch and tighten error handling
- Projects: remove superfluous try/catch around toast; keep explicit error path
- AdminUsers/Sidebar/ShareService: keep minimal catch blocks only to ignore non-JSON parse failures, without swallowing errors
- Lint/format pass remains green
2025-09-22 15:20:46 +03:00

47 lines
1.2 KiB
JavaScript

const { DataTypes } = require('sequelize');
module.exports = (sequelize) => {
const Action = sequelize.define(
'Action',
{
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
actor_user_id: {
type: DataTypes.INTEGER,
allowNull: false,
},
verb: {
type: DataTypes.STRING,
allowNull: false,
},
resource_type: {
type: DataTypes.STRING,
allowNull: false,
},
resource_uid: {
type: DataTypes.STRING,
allowNull: false,
},
target_user_id: {
type: DataTypes.INTEGER,
allowNull: false,
},
access_level: {
type: DataTypes.STRING,
allowNull: true,
},
metadata: {
type: DataTypes.JSON,
allowNull: true,
},
},
{
tableName: 'actions',
}
);
return Action;
};