Removed .js from all imports to smooth ts migration

This commit is contained in:
ThaumRystra
2023-09-28 21:27:05 +02:00
parent 97790264d3
commit ece4a9391a
485 changed files with 1844 additions and 1843 deletions

View File

@@ -1,25 +1,25 @@
import Tabletops from '../../Tabletops.js';
import Tabletops from '../../Tabletops';
export function assertUserInTabletop(tabletopId, userId){
export function assertUserInTabletop(tabletopId, userId) {
let tabletop = Tabletops.findOne(tabletopId);
if (!tabletop){
if (!tabletop) {
throw new Meteor.Error('Tabletop does not exist',
'No tabletop could be found for the given tabletop id');
'No tabletop could be found for the given tabletop id');
}
if (tabletop.gameMaster !== userId && !tabletop.players.includes(userId)){
if (tabletop.gameMaster !== userId && !tabletop.players.includes(userId)) {
throw new Meteor.Error('Not in tabletop',
'The user is not the gamemaster or a player in the given tabletop');
'The user is not the gamemaster or a player in the given tabletop');
}
}
export function assertUserIsTabletopOwner(tabletopId, userId){
export function assertUserIsTabletopOwner(tabletopId, userId) {
let tabletop = Tabletops.findOne(tabletopId);
if (!tabletop){
if (!tabletop) {
throw new Meteor.Error('Tabletop does not exist',
'No tabletop could be found for the given tabletop id');
'No tabletop could be found for the given tabletop id');
}
if (tabletop.gameMaster !== userId){
if (tabletop.gameMaster !== userId) {
throw new Meteor.Error('Not the owner',
'The user is not the owner of the given tabletop');
'The user is not the owner of the given tabletop');
}
}