Skip to content

Commit d47a0ad

Browse files
committed
fix: Load defaults into Settings list.
1 parent 05a65fc commit d47a0ad

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

Backend/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<dependency>
6969
<groupId>de.ree6</groupId>
7070
<artifactId>Ree6-SQL</artifactId>
71-
<version>3.0.0</version>
71+
<version>f42422d84a</version>
7272
</dependency>
7373

7474
<!-- Discord -->

Backend/src/main/java/de/presti/ree6/backend/controller/SettingsController.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,8 @@ public Mono<GenericObjectResponse<List<Setting>>> retrieveSettings(@RequestHeade
5454
return new GenericObjectResponse<>(false, Collections.emptyList(), "Guild doesn't exist.");
5555
}
5656

57-
return SQLSession.getSqlConnector().getSqlWorker().getAllSettings(guildId)
58-
.map(settings -> {
59-
if (settings.isEmpty()) {
60-
return new GenericObjectResponse<>(false,
61-
SettingsManager.getSettings().stream()
62-
.map(x -> new Setting(guildId, x.getName(), x.getDisplayName(), x.getValue())).toList(),
63-
null);
64-
}
65-
66-
return new GenericObjectResponse<>(true, settings, null);
67-
}).block();
57+
return SQLSession.getSqlConnector().getSqlWorker().getAllSettings(guildId, true)
58+
.map(settings -> new GenericObjectResponse<>(true, settings, null)).block();
6859
});
6960
}
7061

0 commit comments

Comments
 (0)