forked from finos/waltz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Services and store for favourite app from waltz-icon
#CTCTOWALTZ-1858 finos#4876
- Loading branch information
1 parent
828cf74
commit 4d3990a
Showing
10 changed files
with
356 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Waltz - Enterprise Architecture | ||
* Copyright (C) 2016, 2017, 2018, 2019 Waltz open source project | ||
* See README.md for more information | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific | ||
* | ||
*/ | ||
|
||
export function store($http, BaseApiUrl) { | ||
|
||
const BASE = `${BaseApiUrl}/favourites`; | ||
|
||
const getFavouritesGroupEntries = () => $http | ||
.get(`${BASE}/entries`) | ||
.then(result => result.data); | ||
|
||
const addApplication = (applicationId) => $http | ||
.post(`${BASE}/application/${applicationId}`) | ||
.then(result => result.data); | ||
|
||
const removeApplication = (applicationId) => $http | ||
.delete(`${BASE}/application/${applicationId}`) | ||
.then(result => result.data); | ||
|
||
return { | ||
getFavouritesGroupEntries, | ||
addApplication, | ||
removeApplication | ||
}; | ||
} | ||
|
||
|
||
store.$inject = [ | ||
'$http', | ||
'BaseApiUrl' | ||
]; | ||
|
||
|
||
const serviceName = "FavouritesStore"; | ||
|
||
|
||
export const FavouritesStore_API = { | ||
getFavouritesGroupEntries: { | ||
serviceName, | ||
serviceFnName: 'getFavouritesGroupEntries', | ||
description: 'fetches application entries for favourites group' | ||
}, | ||
addApplication: { | ||
serviceName, | ||
serviceFnName: 'addApplication', | ||
description: 'executes addApplication' | ||
}, | ||
removeApplication: { | ||
serviceName, | ||
serviceFnName: 'removeApplication', | ||
description: 'executes removeApplication' | ||
} | ||
}; | ||
|
||
export default { | ||
serviceName, | ||
store | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.