Skip to content

Commit

Permalink
Update with better type
Browse files Browse the repository at this point in the history
  • Loading branch information
Baltazore committed Jul 8, 2024
1 parent 40a2e26 commit fa9d1ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snippets/fetching-data/find-record/own-builder.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Bring your own builder
import { buildBaseURL, buildQueryParams } from '@ember-data/request-utils'
import { pluralize } from 'ember-inflector';
import type { FindRecordUrlOptions } from '@ember-data/request-utils';
import type { RequestSignature } from '@warp-drive/core-types/symbols';
import type { TypeFromInstance } from '@warp-drive/core-types/record';
import type { FindRecordOptions } from '@warp-drive/core-types/request';
import type { UrlOptions } from '@ember-data/request-utils';

type MyRequest<Type> = {
url: string
Expand All @@ -18,7 +18,7 @@ type MyRequest<Type> = {
function findRecord<Type>(type: TypeFromInstance<Type>, id: string, options: FindRecordOptions<Type>): MyRequest<Type> {
const identifier = { type, id };

const urlOptions: Partial<UrlOptions> = {
const urlOptions: Partial<FindRecordUrlOptions> = {
op: 'findRecord',
identifier,
resourcePath: pluralize(identifier.type),
Expand Down

0 comments on commit fa9d1ce

Please sign in to comment.