Skip to content

Commit

Permalink
Change POST to PUT when Saving.
Browse files Browse the repository at this point in the history
  • Loading branch information
loosla committed Jul 4, 2024
1 parent cdeacf0 commit 900543c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func TestFilesSaveHandler(t *testing.T) {
content := "This is a test file content."
reqBody := FilesSaveRequest{Password: password, Content: content}
reqBodyBytes, _ := json.Marshal(reqBody)
req, err := http.NewRequest("POST", "/files/save", bytes.NewBuffer(reqBodyBytes))
req, err := http.NewRequest("PUT", "/files/save", bytes.NewBuffer(reqBodyBytes))
if err != nil {
t.Fatalf("Could not save request: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ app.whenReady().then(() => {

// IPC handlers
ipcMain.handle('files-save', async (event, data) => {
await axios.post('http://localhost:8080/files/save', data);
await axios.put('http://localhost:8080/files/save', data);
});

ipcMain.handle('files-content', async (event, password) => {
Expand Down

0 comments on commit 900543c

Please sign in to comment.