fix: format admin url inside forgot pw email (#11509)
### What? Supersedes https://github.com/payloadcms/payload/pull/11490. Refactors imports of `formatAdminURL` to import from `payload/shared` instead of `@payloadcms/ui/shared`. The ui package now imports and re-exports the function to prevent this from being a breaking change. ### Why? This makes it easier for other packages/plugins to consume the `formatAdminURL` function instead of needing to implement their own or rely on the ui package for the utility.
This commit is contained in:
@@ -71,7 +71,7 @@ export class AdminUrlUtil {
|
||||
|
||||
collection(slug: string): string {
|
||||
return formatAdminURL({
|
||||
adminRoute: this.routes.admin,
|
||||
adminRoute: this.routes?.admin,
|
||||
path: `/collections/${slug}`,
|
||||
serverURL: this.serverURL,
|
||||
})
|
||||
@@ -83,7 +83,7 @@ export class AdminUrlUtil {
|
||||
|
||||
global(slug: string): string {
|
||||
return formatAdminURL({
|
||||
adminRoute: this.routes.admin,
|
||||
adminRoute: this.routes?.admin,
|
||||
path: `/globals/${slug}`,
|
||||
serverURL: this.serverURL,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user