Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function publishAd (elems) {
- let publisher = sessionStorage.getItem('userName')
- let title = elems[0].value
- let description = elems[1].value
- let dateOfPublishing = elems[2].value
- let img = elems[3].value|'http://lorempixel.com/400/200/'
- let price = elems[4].value
- let views = 0
- $.ajax({
- url: baas + 'appdata/'+appKey+'/advertisement',
- method:'POST',
- headers: headerMaker('kinvey'),
- data: JSON.stringify({
- views,
- price,
- dateOfPublishing,
- publisher,
- description,
- title,
- img
- }),
- success:()=>successDisplay(),
- error:(e)=>console.log(e)
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement