1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 13:41:57 +02:00

change api endpoints to contractblobs

This commit is contained in:
Tim Daubenschütz 2015-08-31 17:29:43 +02:00
parent 7e1815bb1f
commit 96fdb598f7
5 changed files with 9 additions and 5 deletions

View File

@ -92,7 +92,7 @@ let ContractForm = React.createClass({
<Form <Form
className="ascribe-form-bordered ascribe-form-wrapper" className="ascribe-form-bordered ascribe-form-wrapper"
ref='form' ref='form'
url={ApiUrls.ownership_contract} url={ApiUrls.blob_contracts}
handleSuccess={this.props.handleSuccess} handleSuccess={this.props.handleSuccess}
buttons={<button buttons={<button
type="submit" type="submit"

View File

@ -36,14 +36,14 @@ let ContractSettings = React.createClass({
fileClass: 'contract' fileClass: 'contract'
}} }}
createBlobRoutine={{ createBlobRoutine={{
url: ApiUrls.blob_otherdatas url: ApiUrls.blob_contracts
}} }}
validation={{ validation={{
itemLimit: 100000, itemLimit: 100000,
sizeLimit: '50000000' sizeLimit: '50000000'
}} }}
session={{ session={{
endpoint: ApiUrls.blob_otherdatas, endpoint: ApiUrls.blob_contracts,
customHeaders: { customHeaders: {
'X-CSRFToken': getCookie(AppConstants.csrftoken) 'X-CSRFToken': getCookie(AppConstants.csrftoken)
}, },

View File

@ -297,6 +297,9 @@ var ReactS3FineUploader = React.createClass({
} else if(res.digitalwork) { } else if(res.digitalwork) {
file.s3Url = res.digitalwork.url_safe; file.s3Url = res.digitalwork.url_safe;
file.s3UrlSafe = res.digitalwork.url_safe; file.s3UrlSafe = res.digitalwork.url_safe;
} else if(res.contractblob) {
file.s3Url = res.contractblob.url_safe;
file.s3UrlSafe = res.contractblob.url_safe;
} else { } else {
throw new Error(getLangText('Could not find a url to download.')); throw new Error(getLangText('Could not find a url to download.'));
} }

View File

@ -13,6 +13,7 @@ let ApiUrls = {
'application_token_refresh': AppConstants.apiEndpoint + 'applications/refresh_token/', 'application_token_refresh': AppConstants.apiEndpoint + 'applications/refresh_token/',
'blob_digitalworks': AppConstants.apiEndpoint + 'blob/digitalworks/', 'blob_digitalworks': AppConstants.apiEndpoint + 'blob/digitalworks/',
'blob_otherdatas': AppConstants.apiEndpoint + 'blob/otherdatas/', 'blob_otherdatas': AppConstants.apiEndpoint + 'blob/otherdatas/',
'blob_contracts': AppConstants.apiEndpoint + 'blob/contracts/',
'coa': AppConstants.apiEndpoint + 'coa/${id}/', 'coa': AppConstants.apiEndpoint + 'coa/${id}/',
'coa_create': AppConstants.apiEndpoint + 'coa/', 'coa_create': AppConstants.apiEndpoint + 'coa/',
'coa_verify': AppConstants.apiEndpoint + 'coa/verify_coa/', 'coa_verify': AppConstants.apiEndpoint + 'coa/verify_coa/',
@ -38,7 +39,6 @@ let ApiUrls = {
'ownership_loans_editions': AppConstants.apiEndpoint + 'ownership/loans/editions/', 'ownership_loans_editions': AppConstants.apiEndpoint + 'ownership/loans/editions/',
'ownership_loans_confirm': AppConstants.apiEndpoint + 'ownership/loans/editions/confirm/', 'ownership_loans_confirm': AppConstants.apiEndpoint + 'ownership/loans/editions/confirm/',
'ownership_loans_deny': AppConstants.apiEndpoint + 'ownership/loans/editions/deny/', 'ownership_loans_deny': AppConstants.apiEndpoint + 'ownership/loans/editions/deny/',
'ownership_contract': AppConstants.apiEndpoint + 'ownership/loans/editions/contract/',
'ownership_shares_editions': AppConstants.apiEndpoint + 'ownership/shares/editions/', 'ownership_shares_editions': AppConstants.apiEndpoint + 'ownership/shares/editions/',
'ownership_shares_pieces': AppConstants.apiEndpoint + 'ownership/shares/pieces/', 'ownership_shares_pieces': AppConstants.apiEndpoint + 'ownership/shares/pieces/',
'ownership_transfers': AppConstants.apiEndpoint + 'ownership/transfers/', 'ownership_transfers': AppConstants.apiEndpoint + 'ownership/transfers/',
@ -46,6 +46,7 @@ let ApiUrls = {
'ownership_unconsigns': AppConstants.apiEndpoint + 'ownership/unconsigns/', 'ownership_unconsigns': AppConstants.apiEndpoint + 'ownership/unconsigns/',
'ownership_unconsigns_deny': AppConstants.apiEndpoint + 'ownership/unconsigns/deny/', 'ownership_unconsigns_deny': AppConstants.apiEndpoint + 'ownership/unconsigns/deny/',
'ownership_unconsigns_request': AppConstants.apiEndpoint + 'ownership/unconsigns/request/', 'ownership_unconsigns_request': AppConstants.apiEndpoint + 'ownership/unconsigns/request/',
'ownership_contract': AppConstants.apiEndpoint + 'ownership/contracts/',
'piece': AppConstants.apiEndpoint + 'pieces/${piece_id}/', 'piece': AppConstants.apiEndpoint + 'pieces/${piece_id}/',
'piece_extradata': AppConstants.apiEndpoint + 'pieces/${piece_id}/extradata/', 'piece_extradata': AppConstants.apiEndpoint + 'pieces/${piece_id}/extradata/',
'piece_first_edition_id': AppConstants.apiEndpoint + 'pieces/${piece_id}/edition_index/', 'piece_first_edition_id': AppConstants.apiEndpoint + 'pieces/${piece_id}/edition_index/',

View File

@ -9,7 +9,7 @@ let OwnershipFetcher = {
* Fetch the default, public contract of a user from the API. * Fetch the default, public contract of a user from the API.
*/ */
fetchContract(email) { fetchContract(email) {
return requests.get(ApiUrls.ownership_contract + '?loanee=' + email); return requests.get(ApiUrls.blob_contracts + '?loanee=' + email);
}, },
/** /**