Commit 8deed183 authored by Siedschlag, Lennart's avatar Siedschlag, Lennart
Browse files

merge fixes

parent f5c8d810
Pipeline #7555 passed with stage
in 4 minutes and 57 seconds
......@@ -63,6 +63,7 @@ class Appointment {
location == app.location;
}
@override
String toString() {
return "ID: $id Name: $name Date: $date Time: $time Duration: $duration Location: $location Note: $note";
}
......
......@@ -11,12 +11,12 @@ abstract class Person {
String contactCode;
bool equals(Person person) {
return this.email == person.email &&
this.username == person.username &&
this.name == person.name &&
this.surname == person.surname &&
this.contactCode == person.contactCode &&
this.id == person.id;
return email == person.email &&
username == person.username &&
name == person.name &&
surname == person.surname &&
contactCode == person.contactCode &&
id == person.id;
}
}
......@@ -45,7 +45,7 @@ class User extends Person {
// ggf persistente Daten von einer Service Routine
final List<Contact> _contactlist = List();
int id;
String password;
String mobileNo;
......
......@@ -7,6 +7,7 @@ td{
border-style: solid;
border-color: black;
text-align: center;
cursor: pointer;
}
td:hover{
......
......@@ -53,7 +53,7 @@ table tr{
cursor: default;
}
#delete {
#con {
color: red;
}
......@@ -14,13 +14,16 @@ import 'login_component.dart';
directives: [coreDirectives, routerDirectives],
)
class DayviewComponent implements OnActivate {
// service Klasse für ORM
DayviewComponent(this._appointmentService, this._location, this._router);
final Router _router;
List appointments = List();
Day day;
final Location _location;
// service Klasse für ORM
DayviewComponent(this._appointmentService, this._location, this._router);
final AppointmentService _appointmentService;
......@@ -30,7 +33,7 @@ class DayviewComponent implements OnActivate {
if (!LoginComponent.loggedIn) {
await _router.navigate('/login');
} else {
this.day = Day(
day = Day(
getYear(current.parameters),
getMonth(current.parameters),
getDay(current.parameters));
......
......@@ -49,10 +49,7 @@ class LoginComponent implements OnInit, OnActivate {
}
@override
void ngOnInit() async {
// do something when drawn
// like DB connections //TODO
}
void ngOnInit() async {}
void setLoginFalse() {
loggedIn = false;
......
......@@ -77,7 +77,11 @@ class ContactService {
///Erstellt einen Kontakt und gibt ihn zurück
Future<Contact> find(String contactCode) async {
Contact contact;
final Response response = (await _http.get('$_userUrl/$contactCode')) as Response;
if (response.statusCode.toString() == "404") {
return contact;
}
final User user =
User.fromJson(_extractData(response) as Map<String, dynamic>);
return Contact(user.id, user.username, user.surname, user.name, user.email,
......
......@@ -8,13 +8,6 @@ class AppointmentController extends ResourceController {
final ManagedContext context;
/*
// getall or single
@Operation.get()
Future<Response> getAllAppointments() async {
return Response.ok(_appointments);
}
*/
// getall
@Operation.get()
Future<Response> getAllAppointments() async {
......
......@@ -8,13 +8,7 @@ class UserController extends ResourceController {
final ManagedContext context;
/*
// getall or single
@Operation.get()
Future<Response> getAllAppointments() async {
return Response.ok(_appointments);
}
*/
// getall
@Operation.get()
Future<Response> getAllUsers() async {
......@@ -37,32 +31,6 @@ class UserController extends ResourceController {
return Response.ok(user);
}
@Operation.get('password', 'username')
Future<Response> getUserLoginNickname(@Bind.path('password') String password,
@Bind.path('username') String username) async {
final userQuery = Query<User>(context)
..where((user) => user.hashedPassword).equalTo(password)
..where((user) => user.username).equalTo(username);
final user = await userQuery.fetchOne();
if (user == null) {
return Response.notFound();
}
return Response.ok(user);
}
@Operation.get('password', 'email')
Future<Response> getUserLoginEmail(@Bind.path('password') String password,
@Bind.path('email') String email) async {
final userQuery = Query<User>(context)
..where((user) => user.hashedPassword).equalTo(password)
..where((user) => user.email).equalTo(email);
final user = await userQuery.fetchOne();
if (user == null) {
return Response.notFound();
}
return Response.ok(user);
}
@Operation.post()
Future<Response> newUser() async {
final Map<String, dynamic> body = await request.body.decode();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment