fix user creation condition (#275)
This commit is contained in:
		
							parent
							
								
									7ab400eb7f
								
							
						
					
					
						commit
						9cc30f25e4
					
				| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <div v-if="!user.perm.admin">
 | 
			
		||||
  <div v-if="!user.perm.admin && !isNew">
 | 
			
		||||
    <label for="password">{{ $t("settings.password") }}</label>
 | 
			
		||||
    <input
 | 
			
		||||
      class="input input--block"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -111,14 +111,14 @@ export default {
 | 
			
		|||
      try {
 | 
			
		||||
        if (this.isNew) {
 | 
			
		||||
          const loc = await usersApi.create(this.userPayload); // Use the computed property
 | 
			
		||||
          this.$router.push({ path: loc });
 | 
			
		||||
          this.$router.push({ path: "/settings", hash: "#users-main" });
 | 
			
		||||
          notify.showSuccess(this.$t("settings.userCreated"));
 | 
			
		||||
        } else {
 | 
			
		||||
          let which = ["all"];
 | 
			
		||||
          if (!this.user.perm.admin) {
 | 
			
		||||
            which = ["password"]
 | 
			
		||||
            which = ["password"];
 | 
			
		||||
          }
 | 
			
		||||
          await usersApi.update(this.userPayload,which);
 | 
			
		||||
          await usersApi.update(this.userPayload, which);
 | 
			
		||||
          notify.showSuccess(this.$t("settings.userUpdated"));
 | 
			
		||||
        }
 | 
			
		||||
      } catch (e) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								makefile
								
								
								
								
							
							
						
						
									
										2
									
								
								makefile
								
								
								
								
							| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
setup:
 | 
			
		||||
	echo "creating ./backend/test_config.yaml for local testing..." && \
 | 
			
		||||
	if [ ! -f backend/test__config.yaml ]; then \
 | 
			
		||||
		cp backend/filebrowser.yaml backend/test_config.yaml; \
 | 
			
		||||
		cp backend/config.yaml backend/test_config.yaml; \
 | 
			
		||||
	fi
 | 
			
		||||
	echo "installing swagger needed to generate backend api docs..." && \
 | 
			
		||||
	go install github.com/swaggo/swag/cmd/swag@latest && \
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue