Skip to content

Commit

Permalink
chore: Intento de arreglar el build
Browse files Browse the repository at this point in the history
  • Loading branch information
BarraR3port committed Jun 11, 2024
1 parent 01fd44e commit 3879180
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest]
platform: [windows-latest]
# platform: [windows-latest, macos-latest, ubuntu-latest]

runs-on: ${{ matrix.platform }}
steps:
Expand Down Expand Up @@ -104,6 +105,7 @@ jobs:
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
API_URL: ${{ secrets.API_URL }}
NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }}
with:
releaseId: ${{ needs.create-or-find-release.outputs.release_id }}
7 changes: 5 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ const nextConfig = {
swcMinify: true,
images: {
unoptimized: true,
domains: ["avatars.githubusercontent.com", "images.unsplash.com"]
domains: ["avatars.githubusercontent.com", "images.unsplash.com", "botilleria-admin.vercel.app"]
},
output: "export",
distDir: "dist"
distDir: "dist",
env: {
API_URL: "https://botilleria-admin.vercel.app"
}
};

module.exports = nextConfig;
2 changes: 1 addition & 1 deletion src/components/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function Menu() {
</DialogTrigger>
<MenubarItem
className="hover:cursor-pointer"
onClick={() => openExternalLink(`${process.env.NEXT_PUBLIC_API_URL}/panel`)}
onClick={() => openExternalLink(`${process.env.API_URL}/panel`)}
>
<ExternalLink className="w-4 h-4 mr-2" />
Panel de Administración
Expand Down
2 changes: 1 addition & 1 deletion src/components/store/sale/SearchProducts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function SearchProducts() {
return;
}
const response = await axios
.get(`${process.env.NEXT_PUBLIC_API_URL}/api/products?searchAnyKind=${query}`, {
.get(`${process.env.API_URL}/api/products?searchAnyKind=${query}`, {
headers: {
Authorization: `Bearer ${session.backendTokens.accessToken}`
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/store/user-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function UserIcon({ navBar }: UserIconProps) {
<DropdownMenuGroup>
<DropdownMenuItem
className="hover:cursor-pointer"
onClick={() => openExternalLink(`${process.env.NEXT_PUBLIC_API_URL}/panel`)}
onClick={() => openExternalLink(`${process.env.API_URL}/panel`)}
>
Panel
<DropdownMenuShortcut>
Expand Down
2 changes: 1 addition & 1 deletion src/forms/auth/RecoverForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function RecoverForm() {
const onSubmit: SubmitHandler<RecoverFromType> = async data => {
setLoading(true);
const response = await axios
.post(`${process.env.NEXT_PUBLIC_API_URL}/api/auth/recover`, data)
.post(`${process.env.API_URL}/api/auth/recover`, data)
.catch(res => catchAxiosResponse(res, form))
.then(res => handleAxiosResponse(res, form));

Expand Down
4 changes: 3 additions & 1 deletion src/forms/auth/SignInForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ export function SignInForm() {
const onSubmit: SubmitHandler<SignInFromType> = async data => {
setLoading(true);

console.log("URL", process.env.API_URL, process.env.NEXT_PUBLIC_API_URL);

const response: AuthResponse = await axios
.post(`${process.env.NEXT_PUBLIC_API_URL}/api/auth/signIn`, {
.post(`${process.env.API_URL}/api/auth/signIn`, {
...data
})
.catch(res => catchAxiosResponse(res, form))
Expand Down
2 changes: 1 addition & 1 deletion src/store/app/ProductSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const createProductSlice: StateCreator<SessionSlice & SettingsSlice & Pro
if (!session) return false;
const response = await axios
.post(
`${process.env.NEXT_PUBLIC_API_URL}/api/products/${product.item.id}`,
`${process.env.API_URL}/api/products/${product.item.id}`,
{
quantity: product.quantity
},
Expand Down
4 changes: 2 additions & 2 deletions src/store/app/SessionSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const createSessionSlice: StateCreator<SessionSlice & SettingsSlice & Pro
}
await axios
.post(
`${process.env.NEXT_PUBLIC_API_URL}/api/auth/refresh`,
`${process.env.API_URL}/api/auth/refresh`,
{},
{
headers: {
Expand Down Expand Up @@ -108,7 +108,7 @@ export const createSessionSlice: StateCreator<SessionSlice & SettingsSlice & Pro
}
axios
.post(
`${process.env.NEXT_PUBLIC_API_URL}/api/auth/refresh`,
`${process.env.API_URL}/api/auth/refresh`,
{},
{
headers: {
Expand Down

0 comments on commit 3879180

Please sign in to comment.