The realtime note map has been moved into its own class
to separate the realtime note business logic from the storing logic.
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
Just find the related note in an Interceptor (in both public and private routes)
Related issue: https://github.com/hedgedoc/hedgedoc/issues/1594
Signed-off-by: Lautaro Alvarez <lautarolalvarez@gmail.com>
Signed-off-by: David Mehren <git@herrmehren.de>
For reasons, the typeorm 0.3 broke the find()
method when using relations in the WHERE clause.
This replaces the find method with a query builder.
Signed-off-by: David Mehren <git@herrmehren.de>
For reasons, the typeorm 0.3 broke the find()
method when using relations in the WHERE clause.
This replaces the find method with a query builder.
Signed-off-by: David Mehren <git@herrmehren.de>
For reasons, the typeorm 0.3 broke the find()
method when using relations in the WHERE clause.
This replaces the find method with a query builder.
Signed-off-by: David Mehren <git@herrmehren.de>
For reasons, the typeorm 0.3 broke the find()
method when using relations in the WHERE clause.
This replaces the find method with a query builder.
Signed-off-by: David Mehren <git@herrmehren.de>
`getRevisionUserInfo` returned an incorrect list of usernames,
as users who edited a note at multiple places appeared multiple times.
This commit fixes this behaviour by deduplicating the author
objects using a Set.
Closes#2180
Signed-off-by: David Mehren <git@herrmehren.de>
TypeORM does not use a separate config option for the path
to the SQLite file.
Additionally, the "dialect" is called "type."
This commit adjusts our config to follow the upstream convention
to reduce confusion.
Signed-off-by: David Mehren <git@herrmehren.de>
The primaryAddress field of a note contained the internal UUID of the note when no primary alias was defined instead of the public note id.
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2467b125 mistakenly applied the sanitize function
to the log messages *after* the color was applied.
This commit reverses the order to un-break colored logs.
Signed-off-by: David Mehren <git@herrmehren.de>
This tests the ldap part of the authConfig. Other tests shall be added as the auth method is implemented.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
If an empty string or undefined is provided the method should not return [], but undefined instead. This way defaults defined in Joi function as expected.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
The method should only change error messages if it was called with the correct parameters. Otherwise the function would change e.g `.url` in the error message to `_URL` and the regex is not able to change the front of the error message.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
By default, TypeORM wants to NULL the child-side of a
many-to-one relation, when the relation gets deleted.
This is not possible when the column is not nullable,
so the whole row needs to get deleted.
Signed-off-by: David Mehren <git@herrmehren.de>