Merge branch 'main' into 587-issue---refactor-delete-dialog-logic

This commit is contained in:
yassinedorbozgithub
2025-01-22 17:28:55 +01:00
14 changed files with 58 additions and 32 deletions

View File

@@ -235,6 +235,19 @@ export default abstract class ChannelHandler<
event: EventWrapper<any, any, N>,
): Promise<AttachmentFile | undefined>;
/**
* Fetch the subscriber profile data
*
* @deprecated
* @param event - The message event received
* @returns {Promise<Subscriber>} - The channel's response, otherwise an error
*/
async getUserData(
event: EventWrapper<any, any, N>,
): Promise<SubscriberCreateDto> {
return await this.getSubscriberData(event);
}
/**
* Fetch the subscriber profile data
*

View File

@@ -82,6 +82,10 @@ export class SubscriberRepository extends BaseRepository<
const oldSubscriber = await this.findOne(criteria);
if (!oldSubscriber) {
throw new Error('Something went wrong: subscriber does not exist');
}
if (subscriberUpdates.assignedTo !== oldSubscriber?.assignedTo) {
this.eventEmitter.emit(
'hook:subscriber:assign',

View File

@@ -31,7 +31,11 @@ export type AttachmentRef =
url: string;
};
export interface AttachmentPayload {
/** IMPORTANT: No need to use generic type here */
export interface AttachmentPayload<T extends AttachmentRef = AttachmentRef> {
type: FileType;
payload: AttachmentRef;
payload: T;
}
/** @deprecated */
export type WithUrl<A> = A & { url?: string };