title: API request: better approach to set a Enum value
body: <p>The Backend has an end-point called <code>api/Options/GetEmailMessageTemplate</code>, it returns objects which has this schema:</p>
  
  <pre><code>{
    messageType: string, Enum: [ ConfirmationEmail, 
  ConfirmationTransaction, RecoveryPassword, SetupAdminAccount, ConfirmationApiKey, ConfirmationDepositTransaction ]
    language: string, Enum: [ En, Ru, Zh, Es, Et ]
    subject: string,
    template: string,
    isUsed: boolean
  }
  </code></pre>
  
  <p>e.g. response:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
    "messageType": 1,
    "language": "En",
    "subject": "string",
    "template": "string",
    "isUsed": true
  }
  </code></pre>
  
  <p>here is another end-point to edit it <code>api/Options/Options/UpdateEmailMessageTemplate</code> which consumes json with the same schema as above. <code>messageType</code> might be either number of an element in Enum or Enum value (e.g. <code>'ConfirmationEmail'</code>)</p>
  
  <p>On the Frontend to list all the data and be able to change it I came up with this approach: </p>
  
  <ol>
  <li>I made an strictly ordered array:</li>
  </ol>
  
  <pre><code>messageTypes: [  
   { 
      name: 'Confirmation Email',
      success: false,
   },
  ...
  ]
  </code></pre>
  
  <p>Success is required to show if the change of this template was successful</p>
  
  <ol start="2">
  <li>I get <code>messageType</code>as a number id from backend, I just used it as index in my array (so, for this to work my array must be ordered in the exactly same way Enum of that field is ordered ), to get the name of that <code>messageType</code> and operate with <code>success</code> field</li>
  </ol>
  
  <p>3.<code>api/Options/Options/UpdateEmailMessageTemplate</code> gets <code>messageType</code> using index of the currently being edited element (<code>indexOf</code>) </p>
  
  <p>While this approach worked as was expected I can't help but think there was a better way to handle this. </p>
  
  <p>I would like to hear if there are better practices to handle that</p>