async function m3oRequest(apiName, apiMethod, data) {
  const response = await fetch(
    `https://api.m3o.com/v1/${apiName}/${apiMethod}`,
    {
      method: 'POST',
      body: JSON.stringify(data),
      headers: {
        'Content-Type': 'application/json',
        Authorization: `Bearer ${key}`
      }
    }
  )

  const result = await response.json()

  if (response.ok) {
    return result
  }

  return Promise.reject(result)
}
// 2. Use this code to make requests to the m3o api
2. Use this code to make requests to the m3o api
2 . Use this code to make requests to the m3o api
async function m3oRequest(apiName, apiMethod, data) {
  const response = await fetch(
    `https://api.m3o.com/v1/${apiName}/${apiMethod}`,
    {
      method: 'POST',
      body: JSON.stringify(data),
      headers: {
        'Content-Type': 'application/json',
        Authorization: `Bearer ${key}`
      }
    }
  )
  const result = await response.json()
  if (response.ok) {
    return result
  }
  return Promise.reject(result)
}
async function m3oRequest ( apiName , apiMethod , data ) { const response = await fetch ( ` ${ apiName } ${ apiMethod } ` , { method : 'POST' , body : JSON . stringify ( data ) , headers : { 'Content-Type' : 'application/json' , Authorization : ` ${ key } ` } } ) const result = await response . json ( ) if ( response . ok ) { return result } return Promise . reject ( result ) }
2.
2 .