This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

fix: Siteurl related fixes

  • Loading branch information...
herflis committed Dec 8, 2016
1 parent d0a4675 commit 3bb9327f92fba22f09625aa51dd1639270f50c99

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,6 +1,6 @@
{
"name": "sn-client-js",
"version": "1.0.2-beta.4",
"version": "1.0.2-beta.5",
"description": "A JavaScript client for Sense/Net ECM that makes it easy to use the REST API of the Content Repository.",
"main": "index.js",
"scripts": {
@@ -13,8 +13,23 @@ import { Value, Properties } from 'ts-json-properties';
*/

export module ODataApiActionObservables {
export const ROOT_URL = () => (typeof siteUrl !== 'undefined') ? `${siteUrl}/OData.svc` : '/OData.svc';
export const crossDomainParam = () => (siteUrl === '/') ? false : true;
export const ROOT_URL = () => {
let a = '/';
if (typeof window !== 'undefined' && typeof window['siteUrl'] !== 'undefined') {
return `${window['siteUrl']}/OData.svc`;
}
else {
return '/OData.svc'
}
};
export const crossDomainParam = () => {
if (typeof window !== 'undefined' && typeof window['siteUrl'] !== 'undefined') {
return true;
}
else {
return false;
}
}
/**
* Method to get a Content from the Content Repository through OData REST API.
*
@@ -2,7 +2,7 @@ import { ODataHelper } from './ODataHelper';
import { Content } from './Content';
import 'isomorphic-fetch';
import * as Rx from '@reactivex/rxjs';
import {Value, Properties} from 'ts-json-properties';
import { Value, Properties } from 'ts-json-properties';

/**
* This module contains methods and classes for sending requests and getting responses from the Content Repository through OData REST API.
@@ -11,7 +11,15 @@ import {Value, Properties} from 'ts-json-properties';
* gets their responses as Observables and returns them so that you can subscribe them in your code.
*/
export module ODataApi {
export const ROOT_URL = () => (typeof siteUrl !== 'undefined') ? `${siteUrl}/OData.svc`: '/OData.svc';
export const ROOT_URL = () => {
let a = '/';
if (typeof window !== 'undefined' && typeof window['siteUrl'] !== 'undefined') {
return `${window['siteUrl']}/OData.svc`;
}
else {
return '/OData.svc'
}
};
/**
* Method to get a Content from the Content Repository through OData REST API.
*
@@ -99,11 +99,4 @@ describe('Collection', () => {
expect(typeof collection.AllowedChildTypes({ select: 'Name' })).to.be.eq('object');
});
});
describe('#Upload()', () => {
let c = new Collection(children);
c.Path = 'https://daily.demo.sensenet.com/lorem';
it('should return an Observable object', function () {
expect(typeof c.Upload('File', 'aaa.docx', true, true, 'Binary', 'test')).to.eq('object');
});
});
});
@@ -455,10 +455,4 @@ describe('Content', () => {
expect(typeof content.RemoveMembers([11, 22])).to.eq('object');
});
});
describe('#Upload()', () => {
let c =Content.Create('Article', { Id: 1, Path: 'https://daily.demo.sensenet.com/lorem' });
it('should return an Observable object', function () {
expect(typeof c.Upload('File', 'aaa.docx', true, true, 'Binary', 'test')).to.eq('object');
});
});
});

0 comments on commit 3bb9327

Please sign in to comment.