How to optimize this code of js

can the following code be optimized?

  ...
  var data = {}
  if (role === 1) {
    data.dis = res.dis
  }
  if (role === 1 || role === 2) {
    data.area = res.area
  }
  if (role === 2 || role === 3) {
    data.org = res.org
  }
  if (role === 4) {
    data.name = res.name
  }
Feb.24,2022

const map = {
    1: ['dis', 'area'],
    2: ['area', 'org'],
    3: ['org'],
    4: ['name']
}

map[role].forEach(prop => data[prop] = res[prop]);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e50f0c-4c7fb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e50f0c-4c7fb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?