aboutsummaryrefslogtreecommitdiff
path: root/backend/db/db.go
diff options
context:
space:
mode:
authorJacky Zhao <[email protected]>2020-05-09 21:32:42 -0700
committerGitHub <[email protected]>2020-05-09 21:32:42 -0700
commit11dbd79c57ec1cd08f4753f5c5cc269db9317f5a (patch)
tree1beda0f732febffec221b1d372b1dc75167900b1 /backend/db/db.go
parentMerge pull request #5 from jackyzha0/react (diff)
parentAdd title to post (diff)
downloadctrl-v-11dbd79c57ec1cd08f4753f5c5cc269db9317f5a.tar.xz
ctrl-v-11dbd79c57ec1cd08f4753f5c5cc269db9317f5a.zip
Merge pull request #6 from jackyzha0/backend
Add title to post
Diffstat (limited to 'backend/db/db.go')
-rw-r--r--backend/db/db.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/backend/db/db.go b/backend/db/db.go
index 053ba87..4f638fd 100644
--- a/backend/db/db.go
+++ b/backend/db/db.go
@@ -24,8 +24,8 @@ func init() {
initSessions(mUser, mPass, mIP)
}
-// creates a new paste with content and hash
-func New(ip, content, expiry string) error {
+// creates a new paste with title, content and hash
+func New(ip, content, expiry, title string) error {
// generate hash from ip
hash := hashing.GenerateURI(ip)
@@ -33,6 +33,7 @@ func New(ip, content, expiry string) error {
new := Paste{
Hash: hash,
Content: content,
+ Title: title,
}
// check if expiry