Skip to content

Commit

Permalink
preserve titles on existing resources (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebrehault authored Apr 18, 2024
1 parent 76fe226 commit 7ef650c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuclia-sync-agent-app",
"version": "1.2.20",
"version": "1.2.21",
"description": "This is a Nuclia Sync Agent App",
"main": "build/index.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.2.21 (2024-04-18)

- Do not override title on existing resource

# 1.2.20 (2024-04-16)

- Fix metadata for links
Expand Down
8 changes: 7 additions & 1 deletion server/src/logic/sync/domain/nuclia-cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,13 @@ export class NucliaCloud {

return this.getKb().pipe(
switchMap((kb) =>
kb.createOrUpdateResource(payload).pipe(
kb.hasResource(slug).pipe(
switchMap((exists) => {
if (exists) {
delete payload.title;
}
return kb.createOrUpdateResource(payload);
}),
retry(RETRY_CONFIG),
delay(500), // do not overload the server
catchError((error) => {
Expand Down

0 comments on commit 7ef650c

Please sign in to comment.