Skip to content

Commit

Permalink
Merge pull request #187 from traPtitech/fix/type_error
Browse files Browse the repository at this point in the history
fix/limitとoffsetを暫定でつける
  • Loading branch information
mehm8128 authored Jun 24, 2024
2 parents 87eafe4 + 41005be commit da83a8e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
28 changes: 10 additions & 18 deletions public/mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
/* tslint:disable */

/**
* Mock Service Worker (2.0.5).
* Mock Service Worker.
* @see https://github.com/mswjs/msw
* - Please do NOT modify this file.
* - Please do NOT serve this file on production.
*/

const INTEGRITY_CHECKSUM = '0877fcdc026242810f5bfde0d7178db4'
const PACKAGE_VERSION = '2.3.1'
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
const activeClientIds = new Set()

Expand Down Expand Up @@ -48,7 +49,10 @@ self.addEventListener('message', async function (event) {
case 'INTEGRITY_CHECK_REQUEST': {
sendToClient(client, {
type: 'INTEGRITY_CHECK_RESPONSE',
payload: INTEGRITY_CHECKSUM,
payload: {
packageVersion: PACKAGE_VERSION,
checksum: INTEGRITY_CHECKSUM,
},
})
break
}
Expand Down Expand Up @@ -121,11 +125,6 @@ async function handleRequest(event, requestId) {
if (client && activeClientIds.has(client.id)) {
;(async function () {
const responseClone = response.clone()
// When performing original requests, response body will
// always be a ReadableStream, even for 204 responses.
// But when creating a new Response instance on the client,
// the body for a 204 response must be null.
const responseBody = response.status === 204 ? null : responseClone.body

sendToClient(
client,
Expand All @@ -137,11 +136,11 @@ async function handleRequest(event, requestId) {
type: responseClone.type,
status: responseClone.status,
statusText: responseClone.statusText,
body: responseBody,
body: responseClone.body,
headers: Object.fromEntries(responseClone.headers.entries()),
},
},
[responseBody],
[responseClone.body],
)
})()
}
Expand Down Expand Up @@ -207,13 +206,6 @@ async function getResponse(event, client, requestId) {
return passthrough()
}

// Bypass requests with the explicit bypass header.
// Such requests can be issued by "ctx.fetch()".
const mswIntention = request.headers.get('x-msw-intention')
if (['bypass', 'passthrough'].includes(mswIntention)) {
return passthrough()
}

// Notify the client that a request has been intercepted.
const requestBuffer = await request.arrayBuffer()
const clientMessage = await sendToClient(
Expand Down Expand Up @@ -245,7 +237,7 @@ async function getResponse(event, client, requestId) {
return respondWithMock(clientMessage.data)
}

case 'MOCK_NOT_FOUND': {
case 'PASSTHROUGH': {
return passthrough()
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/features/transaction/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const createTransactionRepository = () => ({
querySeed.target,
querySeed.since,
querySeed.until,
100,
0,
querySeed.tags.join(','),
querySeed.group,
querySeed.request
Expand Down

0 comments on commit da83a8e

Please sign in to comment.