Add Sentry, fix compile errors
This commit is contained in:
@@ -52,12 +52,12 @@ export class BaseClassWithoutId extends BaseEntity {
|
||||
|
||||
static increment<T extends BaseClass>(conditions: FindConditions<T>, propertyPath: string, value: number | string) {
|
||||
const repository = this.getRepository();
|
||||
return repository.increment(conditions, propertyPath, value);
|
||||
return repository.increment(conditions as T, propertyPath, value);
|
||||
}
|
||||
|
||||
static decrement<T extends BaseClass>(conditions: FindConditions<T>, propertyPath: string, value: number | string) {
|
||||
const repository = this.getRepository();
|
||||
return repository.decrement(conditions, propertyPath, value);
|
||||
return repository.decrement(conditions as T, propertyPath, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ export class Channel extends BaseClass {
|
||||
|
||||
static async createDMChannel(recipients: string[], creator_user_id: string, name?: string) {
|
||||
recipients = recipients.unique().filter((x) => x !== creator_user_id);
|
||||
const otherRecipientsUsers = await User.find({ where: recipients.map((x) => ({ id: x })), select: ["id"] });
|
||||
const otherRecipientsUsers = await User.find({ where: recipients.map((x) => ({ id: x })) });
|
||||
|
||||
// TODO: check config for max number of recipients
|
||||
if (otherRecipientsUsers.length !== recipients.length) {
|
||||
|
||||
@@ -188,6 +188,11 @@ export interface ConfigValue {
|
||||
},
|
||||
metrics: {
|
||||
timeout: number;
|
||||
},
|
||||
sentry: {
|
||||
enabled: boolean;
|
||||
endpoint: string;
|
||||
traceSampleRate: number;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -377,5 +382,10 @@ export const DefaultConfigOptions: ConfigValue = {
|
||||
},
|
||||
metrics: {
|
||||
timeout: 30000
|
||||
},
|
||||
sentry: {
|
||||
enabled: false,
|
||||
endpoint: "",
|
||||
traceSampleRate: 1.0
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user