Fixed failing tests

This commit is contained in:
ThaumRystra
2025-01-16 16:24:56 +02:00
parent a2d2f43bed
commit 0bf8fdc6d3
79 changed files with 268 additions and 649 deletions

View File

@@ -1,5 +1,6 @@
import SimpleSchema from 'simpl-schema';
import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS';
import { TypedSimpleSchema } from '/imports/api/utility/TypedSimpleSchema';
export interface Shared {
owner: string,
@@ -9,17 +10,15 @@ export interface Shared {
readersCanCopy?: true,
}
const SharingSchema = new SimpleSchema({
const SharingSchema = TypedSimpleSchema.from({
owner: {
type: String,
regEx: SimpleSchema.RegEx.Id,
//@ts-expect-error index not defined
max: 32,
index: 1
},
readers: {
type: Array,
defaultValue: [],
//@ts-expect-error index not defined
index: 1,
maxCount: STORAGE_LIMITS.readersCount,
},
@@ -30,7 +29,6 @@ const SharingSchema = new SimpleSchema({
writers: {
type: Array,
defaultValue: [],
//@ts-expect-error index not defined
index: 1,
maxCount: STORAGE_LIMITS.writersCount,
},
@@ -41,7 +39,6 @@ const SharingSchema = new SimpleSchema({
public: {
type: Boolean,
defaultValue: false,
//@ts-expect-error index not defined
index: 1,
},
readersCanCopy: {

View File

@@ -52,7 +52,7 @@ const updateUserSharePermissions = new ValidatedMethod({
docRef: RefSchema,
userId: {
type: String,
regEx: SimpleSchema.RegEx.Id,
max: 32,
},
role: {
type: String,
@@ -100,7 +100,7 @@ const transferOwnership = new ValidatedMethod({
docRef: RefSchema,
userId: {
type: String,
regEx: SimpleSchema.RegEx.Id,
max: 32,
},
}).validator(),
mixins: [RateLimiterMixin],