aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/demoApp/src/services/authorService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr/wt/odlux/apps/demoApp/src/services/authorService.ts')
-rw-r--r--sdnr/wt/odlux/apps/demoApp/src/services/authorService.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/sdnr/wt/odlux/apps/demoApp/src/services/authorService.ts b/sdnr/wt/odlux/apps/demoApp/src/services/authorService.ts
index 13e4b316c..deaa2ff76 100644
--- a/sdnr/wt/odlux/apps/demoApp/src/services/authorService.ts
+++ b/sdnr/wt/odlux/apps/demoApp/src/services/authorService.ts
@@ -26,39 +26,39 @@ const base_url = 'https://api.mfico.de/v1/authors';
*/
class AuthorService {
- /**
+ /**
* Gets all known authors from the backend.
* @returns A promise of the type array of @see {@link IAuthor} containing all known authors.
*/
public getAllAuthors(): Promise<IAuthor[]> {
return new Promise((resolve: (value: IAuthor[]) => void, reject: (err: any) => void) => {
- $.ajax({ method: "GET", url: base_url })
- .then((data) => { resolve(data); }, (err) => { reject(err) });
+ $.ajax({ method: 'GET', url: base_url })
+ .then((data) => { resolve(data); }, (err) => { reject(err); });
});
}
- /**
+ /**
* Gets an author by its id from the backend.
* @returns A promise of the type @see {@link IAuthor} containing the author to get.
*/
public getAuthorById(id: string | number): Promise<IAuthor> {
return new Promise((resolve: (value: IAuthor) => void, reject: (err: any) => void) => {
- $.ajax({ method: "GET", url: base_url + "/" + id })
- .then((data) => { resolve(data); }, (err) => { reject(err) });
+ $.ajax({ method: 'GET', url: base_url + '/' + id })
+ .then((data) => { resolve(data); }, (err) => { reject(err); });
});
}
-/**
+ /**
* Saves the given author to the backend api.
* @returns A promise of the type @see {@link IAuthor} containing the autor returned by the backend api.
*/
public saveAuthor(author: IAuthor): Promise<IAuthor> {
return new Promise((resolve: (value: IAuthor) => void, reject: (err: any) => void) => {
- // simulate server save
+ // simulate server save
window.setTimeout(() => {
if (Math.random() > 0.8) {
- reject("Could not save author.");
+ reject('Could not save author.');
} else {
resolve(author);
}