handlers.js 601 Bytes
import { rest } from 'msw'

export const handlers = [
  // sample
  rest.get('/', (req, res, ctx) => {
    ctx.status = 200
    return res(
      ctx.json({
        sample: 'this is a sample'
      })
    )
  }),
  rest.get('https://api/logs', (req, res, ctx) => {
    console.log('yooooooo')
    ctx.status = 200
    return res(
      ctx.json({
        logs: [
          {
            ticket: 'SAM-PLE',
            details:
              'Today ...................................................................................',
            hours: '5'
          }
        ]
      })
    )
  })
]