This commit is contained in:
Tom Moor
2023-07-23 13:11:02 -04:00
parent 217e53d8b6
commit 7bc37cb700
2 changed files with 5 additions and 1 deletions

View File

@@ -352,7 +352,7 @@ export default class Document extends ParanoidModel {
@action
save = async (
fields: Partial<Document> | undefined,
fields?: Partial<Document> | undefined,
options?: SaveOptions | undefined
) => {
const params = fields ?? this.toAPI();

View File

@@ -5,6 +5,7 @@ import teamUpdater from "@server/commands/teamUpdater";
import { sequelize } from "@server/database/sequelize";
import auth from "@server/middlewares/authentication";
import { rateLimiter } from "@server/middlewares/rateLimiter";
import { transaction } from "@server/middlewares/transaction";
import validate from "@server/middlewares/validate";
import { Event, Team, TeamDomain, User } from "@server/models";
import { authorize } from "@server/policies";
@@ -20,7 +21,9 @@ router.post(
rateLimiter(RateLimiterStrategy.TenPerHour),
auth(),
validate(T.TeamsUpdateSchema),
transaction(),
async (ctx: APIContext<T.TeamsUpdateSchemaReq>) => {
const { transaction } = ctx.state;
const { user } = ctx.state.auth;
const team = await Team.findByPk(user.teamId, {
include: [{ model: TeamDomain }],
@@ -32,6 +35,7 @@ router.post(
user,
team,
ip: ctx.request.ip,
transaction,
});
ctx.body = {