User Management

ДОВІДНИК З NODE-RED українською мовою

User Management

Page

image-20230519110441820

Button5 (Create User)

onClick


ButtonGroup1

Edit Role

Disabled


onClick


Delete User

Disabled


onClick

{ { deleteUser.run(() => getUsers.run(), () => {}) } }

Table1

Table Data


ModalEditRole

image-20230519141613367

Text1Copy

Text

Edit User Role: 

field_user_role

Options

{ { getAllRoles.data.map(e=>{
	return{
		"label": e.name,
		"value": e._id
	}
}) } }

Default Value

{
"label": "",
"value": ""
}

Button3Copy (Edit)

onClick


ModalCreateUser

image-20230519141842185

confirm_pass_field

Valid


Error Message

Passwords must be the matching

field_add_user_role

Options

{ { getAllRoles.data.map(e=>{
	return{
		"label": e.name,
		"value": e._id
	}
}) } }

Default Value

{
"label": "User",
"value": "634fe97d28c82b00103cd25d"
}

BtnCreateUser

onClick


APIs

createUser

POST /createUser

body

{
	"firstname": "",
	"lastname": "",
	"email": "",
	"password": "",
	"role": ""
}

Node-RED

deleteUser

DELETE /deleteUser

Node-RED

editUserRole

PUT /editUserRole

body

{
	"role": "",
	"_id": ""
}

Node-RED

getAllRoles

GET /getAllRoles

Node-RED

getUsers

GET /getUsers

Node-RED

JSObject1

export default {
	editUserRole: async () => {
		await editUserRole.run();
		closeModal('ModalEditRole');
		getUsers.run();
	},
	createUser: async () => {
		await createUser.run();
		closeModal('ModalCreateUser');
		getUsers.run();
	}
}