Skip to content

Commit 36759c2

Browse files
committed
search log
1 parent bec3515 commit 36759c2

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

isuumo/webapp/mysql/db/0_Schema.sql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,12 @@ CREATE TABLE isuumo.chair
3636
popularity INTEGER NOT NULL,
3737
stock INTEGER NOT NULL
3838
);
39+
40+
CREATE TABLE isuumo.estate_search_log
41+
(
42+
id INTEGER NOT NULL,
43+
door_height BOOLEAN NOT NULL,
44+
door_width BOOLEAN NOT NULL,
45+
rent BOOLEAN NOT NULL,
46+
features BOOLEAN NOT NULL
47+
);

isuumo/webapp/nodejs/app.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"use strict";
22

3+
require("newrelic");
4+
35
const express = require("express");
46
const morgan = require("morgan");
57
const multer = require("multer");
@@ -438,6 +440,10 @@ app.get("/api/estate/search", async (req, res, next) => {
438440
`${sqlprefix}${searchCondition}${limitOffset}`,
439441
queryParams
440442
);
443+
await query(
444+
"INSERT INTO estate_search_log(id, door_height, door_width, rent, features) VALUES(?,?,?,?,?)",
445+
[1, !!doorHeightRangeId, !!doorWidthRangeId, !!rentRangeId, !!features]
446+
);
441447
res.json({
442448
count,
443449
estates: camelcaseKeys(estates),

0 commit comments

Comments
 (0)