Skip to content

Commit

Permalink
feat: set configuration default version to v5
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadGh committed Dec 12, 2024
1 parent 29f3267 commit 30af0fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { newStrapiSdk } from 'strapi-js' // CommonJS ⇒ const { newStrapiSdk }
const config = {
url: 'http://localhost:1337/',
prefix: '/api',
version: 'v4',
version: 'v5',
logType: 'auto',
retry: 0, // Number of auto retries for requests that have encountered an error
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { StrapiConfig } from './types'
import defu from 'defu'
import { joinURL, normalizeURL } from 'ufo'
import type { StrapiConfig } from './types'

export const strapiDefaultConfig: Required<StrapiConfig> = {
url: 'http://localhost:1337/',
prefix: '/api',
version: 'v4',
version: 'v5',
logType: 'auto',
retry: 0,
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { FetchOptions } from 'ofetch'

export type * from './locales'
export type * from './users'
export type * from './requests'
export type * from './responses'
export type * from './users'

export interface StrapiConfig {
url?: string
prefix?: string
version?: 'v4'
version?: 'v4' | 'v5'
logType?: 'auto' | 'fatal' | 'info' | 'debug'
retry?: number
}
Expand Down

0 comments on commit 30af0fc

Please sign in to comment.