You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
533 B

const { Errors } = require('../../shared')
module.exports = exports = async (message, di) => {
const Node = di.models.get('fs:Node')
const { path, name } = message.data()
const node = await Node.get_path(path, message.socket.session.overlay_name || 'mainline')
if ( !node ) {
return message.send_response(
message.fresh().error(Errors.NodeDoesNotExist)
)
}
message.send_response(
message.fresh().data({ node: node.to_api(), value: node.get_xattr(name)?.value })
)
}