Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use built-in query building function #20

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions ghub.el
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ in which case return nil."
(nconc body
(ghub--request method resource
(cons (cons 'page link)
(cl-delete 'page params :key #'car))
(assq-delete-all 'page params))
data noerror))
body)))))

Expand All @@ -218,10 +218,10 @@ in which case return nil."
(json-read))))

(defun ghub--url-encode-params (params)
(mapconcat (pcase-lambda (`(,key . ,val))
(concat (url-hexify-string (symbol-name key)) "="
(url-hexify-string val)))
params "&"))
(url-build-query-string
(mapcar (lambda (param)
(list (car param) (cdr param)))
params)))

(defun ghub--basic-auth ()
(let ((url (url-generic-parse-url ghub-base-url)))
Expand Down