chore: Simplify model save codepath, prevents text from being sent ever when collab editing enabled

This commit is contained in:
Tom Moor
2022-06-20 22:55:37 +02:00
parent 6975d76faf
commit 9cd3ec0868
4 changed files with 35 additions and 89 deletions

View File

@@ -106,11 +106,14 @@ export default abstract class BaseStore<T extends BaseModel> {
this.data.delete(id);
}
save(params: Partial<T>): Promise<T> {
save(
params: Partial<T>,
options?: Record<string, string | boolean | number | undefined>
): Promise<T> {
if (params.id) {
return this.update(params);
return this.update(params, options);
}
return this.create(params);
return this.create(params, options);
}
get(id: string): T | undefined {