Fix remove post

parent d72fee08
......@@ -241,10 +241,15 @@
(one-line-result
,(format #f "echo -n \"~a040000 tree ~a~/~a~%\" | git mktree"
(if (string-null? cur) cur (string-append cur "\n")) tid article-name)))))
(define (detect-status status)
(match (assoc-ref meta 'status)
("publish" "Add")
("deleted" "Remove")
(else "Add")))
(catch 'colt-err
(lambda ()
(let* ((meta-content (gen-meta-content meta))
(msg (format #f "Added article '~a'" article-name))
(msg (format #f "~a article '~a'" (detect-status meta) article-name))
(mid (git-hash-object meta-content))
(cid (git-hash-object content))
(tid (create-post-dir cid mid)))
......@@ -272,10 +277,14 @@
timestamp article-title))))
(git-post-article url-name article-content (record-type->list article-meta)))))
(define (git-remove-article article-name article-content article-oid)
(define (git-remove-article article-title article-content article-oid)
(let* ((article-meta (git/get-meta-data article-oid)))
(meta-data-status-set! article-meta "deleted")
(git-post-article article-name article-content (record-type->list article-meta))))
(let* ((timestamp (string->number
(meta-data-timestamp article-meta)))
(url-name (uri-encode (gen-proper-url-name
timestamp article-title))))
(git-post-article url-name article-content (record-type->list article-meta)))))
(define (get-all-comment-oids coid)
(catch 'colt-err
......
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