Remove casting from formdata
This commit is contained in:
parent
ce9cde4a0d
commit
7337bceff3
2 changed files with 5 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
when defined(js):
|
||||
import sugar, httpcore, options, json
|
||||
import dom except Event
|
||||
import jsffi except `&`
|
||||
|
||||
include karax/prelude
|
||||
import karax / [kajax, kdom]
|
||||
|
|
@ -44,7 +45,8 @@ when defined(js):
|
|||
formData.append("subject", state.subject)
|
||||
formData.append("msg", state.replyBox.getText())
|
||||
formData.append("categoryId", $categoryID)
|
||||
ajaxPost(uri, @[], cast[cstring](formData),
|
||||
|
||||
ajaxPost(uri, @[], formData.to(cstring),
|
||||
(s: int, r: kstring) => onCreatePost(s, r, state))
|
||||
|
||||
proc render*(state: NewThread, currentUser: Option[User]): VNode =
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ type
|
|||
|
||||
when defined(js):
|
||||
from dom import document
|
||||
import jsffi except `&`
|
||||
|
||||
include karax/prelude
|
||||
import karax / [vstyles, kajax, kdom]
|
||||
|
|
@ -76,7 +77,7 @@ when defined(js):
|
|||
|
||||
state.loading = true
|
||||
|
||||
ajaxPost(uri, @[], cast[cstring](formData),
|
||||
ajaxPost(uri, @[], formData.to(cstring),
|
||||
(s: int, r: kstring) => onCategoryPost(s, r, state))
|
||||
|
||||
proc onPostList(httpStatus: int, response: kstring, postId: Option[int]) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue