delete method

Future<void> delete(
  1. ChatId chatId,
  2. UserId userId
)

Deletes the DtoChatItem identified by the provided chatId and userId from the database.

Implementation

Future<void> delete(ChatId chatId, UserId userId) async {
  await safe((db) async {
    final stmt = db.delete(db.chatMembers);
    stmt.where(
      (u) => u.chatId.equals(chatId.val) & u.userId.equals(userId.val),
    );
    await stmt.goAndReturn();
  }, tag: 'chat_member.delete($chatId, $userId)');
}