diff options
Diffstat (limited to 'lisp/service/resume-service.lisp')
| -rw-r--r-- | lisp/service/resume-service.lisp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lisp/service/resume-service.lisp b/lisp/service/resume-service.lisp index af85714..73fa421 100644 --- a/lisp/service/resume-service.lisp +++ b/lisp/service/resume-service.lisp @@ -808,8 +808,20 @@ fields that get inserted into the add and modify forms." (error (e) (setf (session-value :errormsg) (format nil "Error modifying ~a. ~a" ,component e))))))) - ;; (defun ,func-delete-s () - ;; (,func-delete-s id)) + (defun ,func-delete-s (id) + (with-auth (instance resume-component/modify-service "resume-modify") + (with-resume-database + (let* ((resume-pkg (make-instance 'resume-pkg)) + (user (get-user)) + (,component-s (get-record resume-pkg (make-instance ',component-s + :id id + :user_id (id user) + :*table "resume.contactinfo_v")))) + (if ,component-s + (progn + (delete-record resume-pkg (make-instance ',component-s :id id)) + (setf (session-value :message) (format nil "~a deleted successfully." ,component))) + (setf (session-value :errormsg) (format nil "Error: could not delete ~a: not found." ,component))))))) (define-endpoint (,(format nil "/resume/~a" component-lcase) :method :get) () ,func-root-s) (define-endpoint (,(format nil "/resume/~a/view" component-lcase) :method :get) () ,func-view-s) @@ -817,8 +829,7 @@ fields that get inserted into the add and modify forms." (define-endpoint (,(format nil "/resume/~a/add/submit" component-lcase) :method :post) (&post ,@rest-args) ,func-add-submit-s ,@arg-names) (define-endpoint (,(format nil "/resume/~a/modify" component-lcase) :method :post) (&post (id :parameter-type 'integer)) ,func-modify-s id) (define-endpoint (,(format nil "/resume/~a/modify/submit" component-lcase) :method :post) (&post (id :parameter-type 'integer) ,@rest-args) ,func-modify-submit-s ,@(append '(id) arg-names)) - ;; (define-endpoint (,(format nil "/resume/~a/delete/:id" component-lcase) :method :delete) (&path (id 'integer)) ,func-delete-s) - ))) + (define-endpoint (,(format nil "/resume/~a/delete/:id" component-lcase) :method :delete) (&path (id 'integer)) ,func-delete-s id)))) (define-resume-component (contactinfo ((address :parameter-type 'string) (city :parameter-type 'string) (state_id :parameter-type 'integer) (phone :parameter-type 'string) (email :parameter-type 'string) (url :parameter-type 'string) (visastatus_id :parameter-type 'integer)) |
