1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2025-04-09 10:15:44 +02:00

only take the url as title if the title is not given

This commit is contained in:
Bernhard Posselt 2014-09-12 05:35:29 +02:00
parent cc1dc2ed30
commit 748500380e
4 changed files with 10 additions and 14 deletions

View File

@ -801,14 +801,12 @@ app.factory('FeedResource', ["Resource", "$http", "BASE_URL", "$q", function (Re
if (title !== undefined) {
title = title.trim();
} else {
title = url;
}
var feed = {
url: url,
folderId: folderId || 0,
title: title,
title: title || url,
unreadCount: 0
};
@ -821,9 +819,9 @@ app.factory('FeedResource', ["Resource", "$http", "BASE_URL", "$q", function (Re
method: 'POST',
url: this.BASE_URL + '/feeds',
data: {
url: feed.url,
parentFolderId: feed.folderId,
title: feed.title
url: url,
parentFolderId: folderId || 0,
title: title
}
}).success(function (data) {
deferred.resolve(data);

2
js/build/app.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -190,14 +190,12 @@ app.factory('FeedResource', function (Resource, $http, BASE_URL, $q) {
if (title !== undefined) {
title = title.trim();
} else {
title = url;
}
var feed = {
url: url,
folderId: folderId || 0,
title: title,
title: title || url,
unreadCount: 0
};
@ -210,9 +208,9 @@ app.factory('FeedResource', function (Resource, $http, BASE_URL, $q) {
method: 'POST',
url: this.BASE_URL + '/feeds',
data: {
url: feed.url,
parentFolderId: feed.folderId,
title: feed.title
url: url,
parentFolderId: folderId || 0,
title: title
}
}).success(function (data) {
deferred.resolve(data);

View File

@ -202,11 +202,11 @@ describe('FeedResource', function () {
http.expectPOST('base/feeds', {
parentFolderId: 0,
url: 'http://hey',
title: 'http://hey'
}).respond(200, {});
FeedResource.create('hey', undefined);
expect(FeedResource.get('http://hey').title).toBe('http://hey');
http.flush();
expect(FeedResource.get('http://hey').folderId).toBe(0);