mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 21:30:24 +08:00
feat: filter not selected provider item (#1701)
This commit is contained in:
@ -867,6 +867,8 @@ class ApplicationEditPage extends React.Component {
|
||||
|
||||
submitApplicationEdit(willExist) {
|
||||
const application = Setting.deepCopy(this.state.application);
|
||||
application.providers = application.providers?.filter(provider => this.state.providers.map(provider => provider.name).includes(provider.name));
|
||||
|
||||
ApplicationBackend.updateApplication("admin", this.state.applicationName, application)
|
||||
.then((res) => {
|
||||
if (res.status === "ok") {
|
||||
|
@ -55,11 +55,10 @@ export function getUserApplication(owner, name) {
|
||||
}
|
||||
|
||||
export function updateApplication(owner, name, application) {
|
||||
const newApplication = Setting.deepCopy(application);
|
||||
return fetch(`${Setting.ServerUrl}/api/update-application?id=${owner}/${encodeURIComponent(name)}`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(newApplication),
|
||||
body: JSON.stringify(application),
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
|
Reference in New Issue
Block a user