-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
40 lines (36 loc) · 870 Bytes
/
app.js
File metadata and controls
40 lines (36 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const db = require("./db");
const display = require("./display");
const mRepo = require("./repo/movie-repo");
const pRepo = require("./repo/person-repo");
const qf = {
pgSize: 2,
pgNum: 1,
sort: "title"
};
display.clear();
const edward = { firstname: "Edward", lastname: "Zwick", name: "Edward Zwick" };
const movie = {
id: 0, //new movie
rating_id: 4, //R
director_id: 42,
actors: [16, 42],
tags: [12, 7],
title: "The Last Samurai!",
releaseyr: 2003,
score: 10,
runtime: 154,
lastplaydt: "2015-10-20",
overview:
"An American security advisor falls into the lifestyle of Samurai, He was employed by emperor to destroy the Samurai lands"
};
mRepo
.update(movie)
.then(function(result) {
display.write(result, "pretty");
})
.catch(function(err) {
display.write(err);
})
.finally(function() {
db.destroy();
});