mirror of
https://github.com/pinry/pinry.git
synced 2026-01-23 23:59:21 +01:00
Feature: Use v2-api for pin-detail page
This commit is contained in:
@@ -92,10 +92,8 @@ class PinSerializer(serializers.HyperlinkedModelSerializer):
|
||||
"image_by_id",
|
||||
"tags",
|
||||
)
|
||||
extra_kwargs = {
|
||||
"submitter": {"read_only": True},
|
||||
}
|
||||
|
||||
submitter = UserSerializer(read_only=True)
|
||||
tags = TagSerializer(
|
||||
many=True,
|
||||
source="tag_list",
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* Updated: Feb 26th, 2013
|
||||
* Require: jQuery
|
||||
*/
|
||||
var API_BASE = "/api/v2/";
|
||||
|
||||
|
||||
function _getCookie(name) {
|
||||
@@ -60,15 +61,8 @@ function cleanTags(tags) {
|
||||
return tags;
|
||||
}
|
||||
|
||||
|
||||
function getImageData(imageId) {
|
||||
var apiUrl = '/api/v1/image/'+imageId+'/?format=json';
|
||||
return $.get(apiUrl);
|
||||
}
|
||||
|
||||
|
||||
function getPinData(pinId) {
|
||||
var apiUrl = '/api/v1/pin/'+pinId+'/?format=json';
|
||||
var apiUrl = API_BASE + "pins/" + pinId + '/?format=json';
|
||||
return $.get(apiUrl);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
|
||||
$(window).load(function() {
|
||||
var api_base = "/api/v2/";
|
||||
|
||||
var uploadedImage = false;
|
||||
var editedPin = null;
|
||||
|
||||
@@ -101,7 +99,7 @@ $(window).load(function() {
|
||||
}
|
||||
// Drag and drop upload
|
||||
$('#pin-form-image-upload').dropzone({
|
||||
url: api_base + "images/",
|
||||
url: API_BASE + "images/",
|
||||
paramName: 'image',
|
||||
parallelUploads: 1,
|
||||
uploadMultiple: false,
|
||||
|
||||
Reference in New Issue
Block a user