server-ts: Port services/notes & hidden_subtree

This commit is contained in:
Elian Doran
2024-02-17 22:58:54 +02:00
parent 669988953d
commit de7f4de05b
31 changed files with 267 additions and 202 deletions

View File

@@ -104,13 +104,14 @@ abstract class AbstractBeccaEntity<T extends AbstractBeccaEntity<T>> {
/**
* Saves entity - executes SQL, but doesn't commit the transaction on its own
*/
save(): this {
// FIXME: opts not used but called a few times, maybe should be used by derived classes or passed to beforeSaving.
save(opts?: {}): this {
const constructorData = (this.constructor as unknown as ConstructorData<T>);
const entityName = constructorData.entityName;
const primaryKeyName = constructorData.primaryKeyName;
const isNewEntity = !(this as any)[primaryKeyName];
this.beforeSaving();
const pojo = this.getPojoToSave();