refactor(user): rename to toJson back
This commit is contained in:
@@ -22,7 +22,7 @@ def login():
|
||||
return "Password is too short", 400
|
||||
|
||||
user = User(email, password)
|
||||
return jsonify(user.toDictionary())
|
||||
return jsonify(user.toJson())
|
||||
|
||||
else:
|
||||
return "Request is not a json", 400
|
||||
|
||||
+1
-1
@@ -16,5 +16,5 @@ class User:
|
||||
self.role = 'Backend'#us['role']
|
||||
self.token = generateKey(email, passwd)
|
||||
|
||||
def toDictionary(self):
|
||||
def toJson(self):
|
||||
return {"user": {"id": self.id, "name": self.name, "role": self.role}, "token": self.token}
|
||||
|
||||
Reference in New Issue
Block a user