Add labels property to ContactRaw model and update labels in LABELS_ASSOCIATION event

This commit is contained in:
Judson Cairo
2024-02-08 13:05:06 -03:00
parent 23f1b4ac03
commit c7bed04c80
2 changed files with 41 additions and 12 deletions

View File

@@ -8,6 +8,7 @@ export class ContactRaw {
id?: string;
profilePictureUrl?: string;
owner: string;
labels?: string[];
}
type ContactRawBoolean<T> = {
@@ -21,6 +22,7 @@ const contactSchema = new Schema<ContactRaw>({
id: { type: String, required: true, minlength: 1 },
profilePictureUrl: { type: String, minlength: 1 },
owner: { type: String, required: true, minlength: 1 },
labels: { type: [String], default: [] },
});
export const ContactModel = dbserver?.model(ContactRaw.name, contactSchema, 'contacts');