Skip to content

Commit 8b14a6e

Browse files
committed
fix: fixed config is not working
1 parent 6f4d726 commit 8b14a6e

8 files changed

Lines changed: 10 additions & 11 deletions

File tree

src/main/kotlin/com/panomc/plugins/staffpage/routes/panel/PanelCreateStaffAPI.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import io.vertx.json.schema.common.dsl.Schemas.*
1919
class PanelCreateStaffAPI(
2020
private val plugin: StaffPagePlugin
2121
) : PanelApi() {
22-
override val paths = listOf(Path("/api/panel/staff", RouteType.POST))
22+
override val paths = listOf(Path("/api/panel/staffs", RouteType.POST))
2323

2424
private val authProvider by lazy {
2525
plugin.applicationContext.getBean(AuthProvider::class.java)

src/main/kotlin/com/panomc/plugins/staffpage/routes/panel/PanelDeleteStaffAPI.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import io.vertx.json.schema.common.dsl.Schemas.numberSchema
1717
class PanelDeleteStaffAPI(
1818
private val plugin: StaffPagePlugin
1919
) : PanelApi() {
20-
override val paths = listOf(Path("/api/panel/staff/:id", RouteType.DELETE))
20+
override val paths = listOf(Path("/api/panel/staffs/:id", RouteType.DELETE))
2121

2222
private val authProvider by lazy {
2323
plugin.applicationContext.getBean(AuthProvider::class.java)

src/main/kotlin/com/panomc/plugins/staffpage/routes/panel/PanelGetStaffAPI.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import com.panomc.platform.model.*
66
import com.panomc.plugins.staffpage.StaffPagePlugin
77
import com.panomc.plugins.staffpage.db.dao.StaffMemberDao
88
import com.panomc.plugins.staffpage.permission.ManageStaffPermission
9-
import io.vertx.core.json.JsonArray
109
import io.vertx.core.json.JsonObject
1110
import io.vertx.ext.web.RoutingContext
1211
import io.vertx.ext.web.validation.ValidationHandler
@@ -17,7 +16,7 @@ import io.vertx.json.schema.SchemaRepository
1716
class PanelGetStaffAPI(
1817
private val plugin: StaffPagePlugin
1918
) : PanelApi() {
20-
override val paths = listOf(Path("/api/panel/staff", RouteType.GET))
19+
override val paths = listOf(Path("/api/panel/staffs", RouteType.GET))
2120

2221
private val authProvider by lazy {
2322
plugin.applicationContext.getBean(AuthProvider::class.java)

src/main/kotlin/com/panomc/plugins/staffpage/routes/panel/PanelUpdateStaffAPI.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import io.vertx.json.schema.common.dsl.Schemas.*
2020
class PanelUpdateStaffAPI(
2121
private val plugin: StaffPagePlugin
2222
) : PanelApi() {
23-
override val paths = listOf(Path("/api/panel/staff/:id", RouteType.PUT))
23+
override val paths = listOf(Path("/api/panel/staffs/:id", RouteType.PUT))
2424

2525
private val authProvider by lazy {
2626
plugin.applicationContext.getBean(AuthProvider::class.java)

src/main/kotlin/com/panomc/plugins/staffpage/routes/theme/ThemeGetStaffAPI.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import io.vertx.json.schema.SchemaRepository
1414
class ThemeGetStaffAPI(
1515
private val plugin: StaffPagePlugin
1616
) : Api() {
17-
override val paths = listOf(Path("/api/staff", RouteType.GET))
17+
override val paths = listOf(Path("/api/staffs", RouteType.GET))
1818

1919
private val staffMemberDao by lazy {
2020
plugin.pluginBeanContext.getBean(StaffMemberDao::class.java)

src/panel/StaffManagementPage.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
4545
try {
4646
const res = await ApiUtil.get({
47-
path: '/api/panel/staff',
47+
path: '/api/panel/staffs',
4848
request: event,
4949
});
5050
return {
@@ -85,7 +85,7 @@
8585
loading = true;
8686
try {
8787
const res = await ApiUtil.get({
88-
path: '/api/panel/staff',
88+
path: '/api/panel/staffs',
8989
});
9090
data.staff = (res.staff || []).sort((a, b) => a.id - b.id);
9191
} catch (e) {

src/panel/modals/AddEditStaffModal.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@
266266
267267
try {
268268
if (currentMode === 'edit') {
269-
await ApiUtil.put({ path: `/api/panel/staff/${currentStaff.id}`, body });
269+
await ApiUtil.put({ path: `/api/panel/staffs/${currentStaff.id}`, body });
270270
} else {
271-
await ApiUtil.post({ path: '/api/panel/staff', body });
271+
await ApiUtil.post({ path: '/api/panel/staffs', body });
272272
}
273273
274274
showToast(currentMode === 'edit' ? $_('toasts.staff-updated') : $_('toasts.staff-created'));

src/theme/StaffPage.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
export async function load(event) {
1313
try {
1414
const [staffRes, configRes] = await Promise.all([
15-
ApiUtil.get({ path: '/api/staff', request: event }),
15+
ApiUtil.get({ path: '/api/staffs', request: event }),
1616
ApiUtil.get({ path: '/api/staff/config', request: event }),
1717
]);
1818

0 commit comments

Comments
 (0)