Compare commits
No commits in common. "dev" and "main" have entirely different histories.
@ -59,14 +59,3 @@ func Create(name string, skin Skin) (Character, error) {
|
|||||||
|
|
||||||
return api.Post[Character]("/characters/create", newChar, responseCodes)
|
return api.Post[Character]("/characters/create", newChar, responseCodes)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Character) Refresh() error {
|
|
||||||
char, err := Get(c.Name)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
*c = char
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
package characters_test
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"git.stinnesbeck.com/nils/artifacts/characters"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestGetRefresh(t *testing.T) {
|
|
||||||
char, err := characters.Get("Nils")
|
|
||||||
if err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := char.Refresh(); err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user