Skip to content

Commit

Permalink
fix update Server IP
Browse files Browse the repository at this point in the history
  • Loading branch information
yakuter committed Jul 4, 2020
1 parent ff5f6b6 commit 181ee24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions internal/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package api

import (
"encoding/json"
"fmt"
"net/http"
"strconv"

Expand Down Expand Up @@ -71,6 +72,8 @@ func CreateServer(s storage.Store) http.HandlerFunc {
}
defer r.Body.Close()

fmt.Println(serverDTO)

schema := r.Context().Value("schema").(string)
createdServer, err := app.CreateServer(s, &serverDTO, schema)
if err != nil {
Expand Down Expand Up @@ -99,6 +102,9 @@ func UpdateServer(s storage.Store) http.HandlerFunc {
return
}
defer r.Body.Close()

fmt.Println(serverDTO)

schema := r.Context().Value("schema").(string)
server, err := s.Servers().FindByID(uint(id), schema)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func CreateServer(s storage.Store, dto *model.ServerDTO, schema string) (*model.
func UpdateServer(s storage.Store, server *model.Server, dto *model.ServerDTO, schema string) (*model.Server, error) {

server.Title = dto.Title
server.IP = dto.Title
server.IP = dto.IP
server.Username = dto.Username
server.Password = dto.Password
server.URL = dto.URL
Expand Down

0 comments on commit 181ee24

Please sign in to comment.