Replace getDefaultApplication() with getUserApplication().

This commit is contained in:
Yang Luo
2021-07-11 23:49:06 +08:00
parent 2be7d28a6c
commit dc0712c8a5
5 changed files with 16 additions and 20 deletions

View File

@ -49,7 +49,7 @@ class UserEditPage extends React.Component {
UNSAFE_componentWillMount() {
this.getUser();
this.getOrganizations();
this.getDefaultApplication();
this.getUserApplication();
}
getUser() {
@ -70,8 +70,8 @@ class UserEditPage extends React.Component {
});
}
getDefaultApplication() {
ApplicationBackend.getDefaultApplication("admin")
getUserApplication() {
ApplicationBackend.getUserApplication(this.state.organizationName, this.state.userName)
.then((application) => {
this.setState({
application: application,

View File

@ -28,8 +28,8 @@ export function getApplication(owner, name) {
}).then(res => res.json());
}
export function getDefaultApplication(owner) {
return fetch(`${Setting.ServerUrl}/api/get-default-application?owner=${owner}`, {
export function getUserApplication(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-user-application?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
}).then(res => res.json());