clear chat connection

This commit is contained in:
Peter Maquiran
2024-09-13 15:33:40 +01:00
parent e0bd6fdf44
commit ed1b0c01d7
4 changed files with 27 additions and 8 deletions
+2
View File
@@ -25,4 +25,6 @@ export abstract class IDexieRepository<T, R, I = EntityTable<any, any>> {
abstract findAll(): Promise<RepositoryResult<T[], T>>
abstract count(filter?: Object): Promise<RepositoryResult<number, T>>
abstract clear(): Promise<Result<any, any>>
}
@@ -253,4 +253,13 @@ export class DexieRepository<T, R, I = EntityTable<any, any>> implements IDexieR
}))
}
}
async clear() {
try {
const result = await this.table.clear()
return ok(result)
} catch (e) {
return err(false)
}
}
}