chore: Remove over-usage of invariant (#3719)

This commit is contained in:
Tom Moor
2022-07-02 15:29:39 +03:00
committed by GitHub
parent 108b5b934a
commit c9cd424a8d
16 changed files with 34 additions and 55 deletions

View File

@@ -26,7 +26,6 @@ import {
Star,
User,
View,
Team,
} from "@server/models";
import { authorize, cannot } from "@server/policies";
import {
@@ -626,7 +625,7 @@ router.post(
}
teamId = share.teamId;
const team = await Team.findByPk(teamId);
const team = await share.$get("team");
invariant(team, "Share must belong to a team");
response = await Document.searchForTeam(team, query, {