import { formatAdminURL } from 'payload/shared';
export const handleGoBack = ({
  adminRoute,
  collectionSlug,
  router,
  serverURL
}) => {
  const redirectRoute = formatAdminURL({
    adminRoute,
    path: collectionSlug ? `/collections/${collectionSlug}` : '/',
    serverURL
  });
  router.push(redirectRoute);
};
//# sourceMappingURL=handleGoBack.js.map