refactor: swap HTTP methods for user creation and update endpoints (closes #351) (#354)

This commit is contained in:
Sleeyax
2025-09-06 15:14:29 +02:00
committed by GitHub
parent dae054fd6b
commit b7569ce77a
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -75,7 +75,7 @@ export class UserConfigAPI {
): Promise<ApiResponse<CreateUserResponse>> {
try {
const response = await fetch(`${this.BASE_URL}/user`, {
method: 'PUT',
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
@@ -125,7 +125,7 @@ export class UserConfigAPI {
): Promise<ApiResponse<void>> {
try {
const response = await fetch(`${this.BASE_URL}/user`, {
method: 'POST',
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
+2 -2
View File
@@ -105,7 +105,7 @@ router.get('/', async (req, res, next) => {
});
// new user creation
router.put('/', async (req, res, next) => {
router.post('/', async (req, res, next) => {
const { config, password } = req.body;
if (!config || !password) {
next(
@@ -143,7 +143,7 @@ router.put('/', async (req, res, next) => {
});
// updating user details
router.post('/', async (req, res, next) => {
router.put('/', async (req, res, next) => {
const { uuid, password, config } = req.body;
if (!uuid || !password || !config) {
next(