Skip to content
Snippets Groups Projects
Commit 2979f24c authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5044 Recovered default for application settings

parent 7a6effcf
Branches
Tags
No related merge requests found
......@@ -24,7 +24,6 @@ package de.ozgcloud.admin.setting;
import jakarta.validation.Valid;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.TypeAlias;
import org.springframework.data.mongodb.core.mapping.Document;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
......@@ -38,7 +37,6 @@ import lombok.extern.jackson.Jacksonized;
@Getter
@Jacksonized
@Document(Setting.COLLECTION_NAME)
@TypeAlias("de.ozgcloud.admin.settings.Settings")
public class Setting {
static final String COLLECTION_NAME = "settings";
......
......@@ -26,6 +26,6 @@ class SettingService {
PostfachSettingBody getSettingWithPostfachFromDb() {
var postfach = repository.findOneByName(POSTFACH_SETTING_ITEM_NAME);
return postfach.map(Setting::getSettingBody).map(PostfachSettingBody.class::cast).orElse(PostfachSettingBody.builder().build());
return postfach.isPresent() ? (PostfachSettingBody) postfach.get().getSettingBody() : PostfachSettingBody.builder().build();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment