From 25009ba6d7e526479c55abb1feaf5d0cb32aaf08 Mon Sep 17 00:00:00 2001 From: Anan Zhuang Date: Wed, 19 Jun 2024 10:35:47 -0700 Subject: [PATCH] [BUG][NewHomePage] Temp Solution to avoid crash for user with no write permission (#7054) * [BUG][NewHomePage] Temp Solution to avoid crash for anonymous user with no write permission Issue Resolve: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/6320 --------- Signed-off-by: Anan Zhuang Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> --- changelogs/fragments/7054.yml | 2 ++ .../home/public/services/section_type/section_type.ts | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/7054.yml diff --git a/changelogs/fragments/7054.yml b/changelogs/fragments/7054.yml new file mode 100644 index 000000000000..913b2671d294 --- /dev/null +++ b/changelogs/fragments/7054.yml @@ -0,0 +1,2 @@ +fix: +- [BUG][NewHomePage] Temp Solution to avoid crash for anonymous user with no write permission ([#7054](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7054)) \ No newline at end of file diff --git a/src/plugins/home/public/services/section_type/section_type.ts b/src/plugins/home/public/services/section_type/section_type.ts index 5b57b6e0f272..89b66bfedae9 100644 --- a/src/plugins/home/public/services/section_type/section_type.ts +++ b/src/plugins/home/public/services/section_type/section_type.ts @@ -127,10 +127,7 @@ export class SectionTypeService { } if (heroes || sections) { - homepage - .save({}) - .then(() => error$.next(undefined)) - .catch((e) => error$.next(e)); + homepage.save({}); } }) );