Skip to content

Commit

Permalink
Merge pull request #120 from jamalsoueidan/fix-service-and-remove-embla
Browse files Browse the repository at this point in the history
fix service url and remove embla
  • Loading branch information
jamalsoueidan authored Jul 12, 2024
2 parents 12f5dc8 + 88526f6 commit 8528d9a
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 141 deletions.
32 changes: 0 additions & 32 deletions app/components/Slider.module.css

This file was deleted.

31 changes: 0 additions & 31 deletions app/components/Slider.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import carouselStyles from '@mantine/carousel/styles.css?url';
import {
ColorSchemeScript,
DirectionProvider,
Expand Down Expand Up @@ -67,7 +66,6 @@ export const shouldRevalidate: ShouldRevalidateFunction = ({
export const links = () => {
return [
{rel: 'stylesheet', href: appStyles},
{rel: 'stylesheet', href: carouselStyles},
{rel: 'stylesheet', href: coreStyles},
{rel: 'stylesheet', href: nprogressStyles},
{
Expand Down
2 changes: 1 addition & 1 deletion app/routes/business.locations._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {getCustomer} from '~/lib/get-customer';
export async function loader({context}: LoaderFunctionArgs) {
const customerId = await getCustomer({context});
const {payload: locations} =
await getBookingShopifyApi().customerLocationList(customerId, context);
await getBookingShopifyApi().customerLocationList(customerId);

return json({locations});
}
Expand Down
5 changes: 0 additions & 5 deletions app/routes/business.locations.create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {RadioGroup} from '~/components/form/RadioGroup';
import {SubmitButton} from '~/components/form/SubmitButton';
import {getBookingShopifyApi} from '~/lib/api/bookingShopifyApi';
import {CustomerLocationBaseLocationType} from '~/lib/api/model';
import {baseURL} from '~/lib/api/mutator/query-client';

const schema = customerLocationCreateBody;

Expand All @@ -45,10 +44,6 @@ export const action = async ({request, context}: ActionFunctionArgs) => {
submission.value,
);

await context.storefront.cache?.delete(
`${baseURL}/customer/${customerId}/locations`,
);

return redirect('/business/locations');
} catch (error) {
return submission.reply();
Expand Down
38 changes: 19 additions & 19 deletions app/routes/business.public._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,6 @@ export default function AccountBusiness() {
]}
/>

<MultiTags
field={professions}
data={professionOptions}
label="Hvad er dine professioner"
placeholder="Vælg professioner"
/>

<MultiTags
field={specialties}
data={skillsOptions}
label="Hvad er dine specialer?"
placeholder="Vælge special(er)?"
/>

<TextInput
label="Års erfaring"
{...getInputProps(yearsExperience, {type: 'number'})}
/>

<MultiTags
field={speaks}
data={[
Expand Down Expand Up @@ -158,6 +139,25 @@ export default function AccountBusiness() {
/>
</div>

<MultiTags
field={professions}
data={professionOptions}
label="Hvad er dine professioner"
placeholder="Vælg professioner"
/>

<MultiTags
field={specialties}
data={skillsOptions}
label="Hvad er dine specialer?"
placeholder="Vælge special(er)?"
/>

<TextInput
label="Års erfaring"
{...getInputProps(yearsExperience, {type: 'number'})}
/>

<div>
<SubmitButton>Gem ændringer</SubmitButton>
</div>
Expand Down
21 changes: 12 additions & 9 deletions app/routes/business.services.create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import {
type CustomerProductLocationsItem,
type OpenAIProductTitle200Payload,
} from '~/lib/api/model';
import {baseURL} from '~/lib/api/mutator/query-client';
import {convertHTML} from '~/lib/convertHTML';
import {getCustomer} from '~/lib/get-customer';
import {customerProductAddBody} from '~/lib/zod/bookingShopifyApi';
Expand Down Expand Up @@ -75,10 +74,6 @@ export const action = async ({request, context}: ActionFunctionArgs) => {
},
);

await context.storefront.cache?.delete(
`${baseURL}/customer/${customerId}/products`,
);

return redirect(`/business/services/${product.productId}`);
} catch (error) {
return submission.reply();
Expand All @@ -99,10 +94,10 @@ export async function loader({context}: LoaderFunctionArgs) {
);

const {payload: schedules} =
await getBookingShopifyApi().customerScheduleList(customerId, context);
await getBookingShopifyApi().customerScheduleList(customerId);

const {payload: locations} =
await getBookingShopifyApi().customerLocationList(customerId, context);
await getBookingShopifyApi().customerLocationList(customerId);

if (locations.length === 0 || schedules.length === 0) {
return redirect('/business/services');
Expand Down Expand Up @@ -163,7 +158,7 @@ export default function AccountServicesCreate() {
const aiSuggestion = useCallback(() => {
fetcher.submit(
{title: fields.title.value || ''},
{action: '/business/api/ai-suggestion'},
{action: '/business/api/ai/product'},
);
}, [fetcher, fields.title.value]);

Expand All @@ -174,13 +169,21 @@ export default function AccountServicesCreate() {
name: fields.productType.name,
value: fetcher.data.collection?.title || '',
});
form.update({
name: fields.price.name,
value: {
amount: fetcher.data.price,
currencyCode: 'DKK',
},
});
setDescriptionHtml(fetcher.data.description);
fetcher.load('/business/api/ai-suggestion'); //reset
fetcher.load('/api/reset'); //reset
}
}, [
fetcher,
fetcher.data,
fetcher.state,
fields.price.name,
fields.productType.name,
fields.title.name,
fields.title.value,
Expand Down
39 changes: 0 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@fullcalendar/interaction": "^6.1.14",
"@fullcalendar/react": "^6.1.14",
"@fullcalendar/timegrid": "^6.1.14",
"@mantine/carousel": "^7.11.0",
"@mantine/core": "^7.11.0",
"@mantine/hooks": "^7.11.0",
"@mantine/modals": "^7.11.0",
Expand Down Expand Up @@ -58,8 +57,6 @@
"country-flag-icons": "^1.5.11",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.1",
"embla-carousel-autoplay": "^7.1.0",
"embla-carousel-react": "^7.1.0",
"graphql": "^16.6.0",
"graphql-tag": "^2.12.6",
"i18next": "^23.11.5",
Expand Down

0 comments on commit 8528d9a

Please sign in to comment.