Update endpoint APIs
This commit is contained in:
parent
c26778a913
commit
23b7dbd414
2 changed files with 7 additions and 11 deletions
|
@ -178,7 +178,7 @@ class PhotoSyncManager {
|
|||
"token": Configuration.instance.getToken(),
|
||||
});
|
||||
return _dio
|
||||
.post(Configuration.instance.getHttpEndpoint() + "/files/upload",
|
||||
.post(Configuration.instance.getHttpEndpoint() + "/files",
|
||||
data: formData)
|
||||
.then((response) {
|
||||
_logger.info(response.toString());
|
||||
|
|
|
@ -16,11 +16,10 @@ class UserAuthenticator {
|
|||
|
||||
Future<bool> login(String username, String password) {
|
||||
return _dio.post(
|
||||
"http://" + Configuration.instance.getEndpoint() + ":8080/users/login",
|
||||
queryParameters: {
|
||||
"username": username,
|
||||
"password": password
|
||||
}).then((response) {
|
||||
"http://" +
|
||||
Configuration.instance.getEndpoint() +
|
||||
":8080/users/authenticate",
|
||||
data: {"username": username, "password": password}).then((response) {
|
||||
if (response.statusCode == 200 && response.data != null) {
|
||||
Configuration.instance.setUsername(username);
|
||||
Configuration.instance.setPassword(password);
|
||||
|
@ -38,11 +37,8 @@ class UserAuthenticator {
|
|||
|
||||
Future<bool> create(String username, String password) {
|
||||
return _dio.post(
|
||||
"http://" + Configuration.instance.getEndpoint() + ":8080/users/create",
|
||||
queryParameters: {
|
||||
"username": username,
|
||||
"password": password
|
||||
}).then((response) {
|
||||
"http://" + Configuration.instance.getEndpoint() + ":8080/users",
|
||||
data: {"username": username, "password": password}).then((response) {
|
||||
if (response.statusCode == 200 && response.data != null) {
|
||||
Configuration.instance.setUsername(username);
|
||||
Configuration.instance.setPassword(password);
|
||||
|
|
Loading…
Add table
Reference in a new issue