-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ (route.ts): add new Shopify customer route handlers for POST and GE…
…T requests ✨ (index.ts): introduce CreateShopifyCustomer and GetShopifyCustomer handling logic ✅ (index.spec.ts): update tests to reflect new authorization logic and error handling ♻️ (index.ts): refactor error handling to use ForbiddenError for address mismatches 🔧 (index.ts): add CreateShopifyCustomerOptions and GetShopifyCustomerOptions types ✨ (validators.ts): Add CreateShopifyCustomerParams and GetShopifyCustomerParams for Shopify integration ♻️ (apiErrorHandlers.ts): Refactor NotAuthorizedError to use 401 status code and introduce ForbiddenError with 403 status ✅ (index.spec.ts): Update tests to reflect new error handling logic and test ForbiddenError handling
- Loading branch information
1 parent
4ec3a8f
commit f630df8
Showing
6 changed files
with
261 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ShopifyWebhookAndApiHandler } from '@integrations/external-api-handlers'; | ||
import { NextRequest } from 'next/server'; | ||
|
||
export async function POST( | ||
req: NextRequest, | ||
{ params: { id } }: { params: { id: string } }, | ||
) { | ||
const shopifyHandler = new ShopifyWebhookAndApiHandler(); | ||
return shopifyHandler.createShopifyCustomer({ | ||
req, | ||
id, | ||
}); | ||
} | ||
|
||
export async function GET( | ||
req: NextRequest, | ||
{ params: { id } }: { params: { id: string } }, | ||
) { | ||
const shopifyHandler = new ShopifyWebhookAndApiHandler(); | ||
return shopifyHandler.hasShopifyCustomer({ req, id }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.