Skip to content

Commit cdeb939

Browse files
committed
chore(auto-grader): log out test data
1 parent 4b47c1e commit cdeb939

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

server/controllers/property.controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class PropertyController {
6363
newProperty.id = property_id;
6464
const property = new PropertyModel({ ...newProperty });
6565
await property.updateProperty();
66-
return Response.handleSuccess(200, 'Updated Successfully', property.result[0], res);
66+
return Response.handleSuccess(200, 'Updated Successfully', property.result, res);
6767
} catch (error) {
6868
return Response.handleError(500, error.toString(), res);
6969
}
@@ -75,7 +75,7 @@ class PropertyController {
7575
const soldProperty = { status: 'sold' };
7676
const property = new PropertyModel({ id, ...soldProperty });
7777
await property.updateProperty();
78-
return Response.handleSuccess(200, 'Mark as sold successfully', property.result[0], res);
78+
return Response.handleSuccess(200, 'Mark as sold successfully', property.result, res);
7979
} catch (error) {
8080
return Response.handleError(500, error.toString(), res);
8181
}

server/models/model.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Model {
1818

1919
async update(db, obj) {
2020
const index = obj.id - 1;
21-
this.result = db.splice(index, 1, Object.assign(db[index], obj));
21+
this.result[0] = db.splice(index, 1, Object.assign(db[index], obj));
2222
}
2323
}
2424

0 commit comments

Comments
 (0)