Merge pull request #376 from Irev-Dev/kurt/375-missing-images
missing images
This commit was merged in pull request #376.
This commit is contained in:
5
.vscode/settings.json
vendored
Normal file
5
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"Hutten"
|
||||
]
|
||||
}
|
||||
@@ -5,7 +5,6 @@
|
||||
"dependencies": {
|
||||
"@redwoodjs/api": "^0.34.1",
|
||||
"@sentry/node": "^6.5.1",
|
||||
"cloudinary": "^1.23.0",
|
||||
"graphql-tag": "^2.12.4"
|
||||
"cloudinary": "^1.23.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ app.post('/cadquery/stl', async (req, res) => {
|
||||
console.log('making post request to 5060')
|
||||
try {
|
||||
const { data } = await axios.post(invocationURL(5060), {
|
||||
body: req.body
|
||||
body: req.body,
|
||||
})
|
||||
res.status(data.statusCode)
|
||||
res.send(data.body)
|
||||
|
||||
@@ -17,9 +17,7 @@ export const handler = createGraphQLHandler({
|
||||
schemas,
|
||||
services: makeServices({ services }),
|
||||
}),
|
||||
plugins: [
|
||||
createSentryApolloPlugin(),
|
||||
],
|
||||
plugins: [createSentryApolloPlugin()],
|
||||
onException: () => {
|
||||
// Disconnect from your database with an unhandled exception.
|
||||
db.$disconnect()
|
||||
|
||||
@@ -62,45 +62,44 @@ export const createSentryApolloPlugin: Config['plugins'][number] = () => ({
|
||||
// If we couldn't parse the operation, don't
|
||||
// do anything here
|
||||
if (!ctx.operation) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
for (const err of ctx.errors) {
|
||||
// Only report internal server errors,
|
||||
// all errors extending ApolloError should be user-facing
|
||||
if (err instanceof ApolloError) {
|
||||
continue;
|
||||
continue
|
||||
}
|
||||
|
||||
// Add scoped report details and send to Sentry
|
||||
Sentry.withScope(scope => {
|
||||
Sentry.withScope((scope) => {
|
||||
// Annotate whether failing operation was query/mutation/subscription
|
||||
scope.setTag("kind", ctx.operation.operation);
|
||||
scope.setTag('kind', ctx.operation.operation)
|
||||
|
||||
// Log query and variables as extras (make sure to strip out sensitive data!)
|
||||
scope.setExtra("query", ctx.request.query);
|
||||
scope.setExtra("variables", ctx.request.variables);
|
||||
scope.setExtra('query', ctx.request.query)
|
||||
scope.setExtra('variables', ctx.request.variables)
|
||||
|
||||
if (err.path) {
|
||||
// We can also add the path as breadcrumb
|
||||
scope.addBreadcrumb({
|
||||
category: "query-path",
|
||||
message: err.path.join(" > "),
|
||||
level: Sentry.Severity.Debug
|
||||
});
|
||||
category: 'query-path',
|
||||
message: err.path.join(' > '),
|
||||
level: Sentry.Severity.Debug,
|
||||
})
|
||||
}
|
||||
|
||||
const transactionId = ctx.request.http.headers.get(
|
||||
"x-transaction-id"
|
||||
);
|
||||
const transactionId =
|
||||
ctx.request.http.headers.get('x-transaction-id')
|
||||
if (transactionId) {
|
||||
scope.setTransaction(transactionId);
|
||||
scope.setTransaction(transactionId)
|
||||
}
|
||||
|
||||
Sentry.captureException(err);
|
||||
});
|
||||
Sentry.captureException(err)
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -77,13 +77,13 @@ export const updatePart = async ({ id, input }) => {
|
||||
}
|
||||
const originalPart = await db.part.findUnique({ where: { id } })
|
||||
const imageToDestroy =
|
||||
originalPart.mainImage !== input.mainImage && originalPart.mainImage
|
||||
originalPart.mainImage !== input.mainImage && input.mainImage && originalPart.mainImage
|
||||
const update = await db.part.update({
|
||||
data: foreignKeyReplacement(input),
|
||||
where: { id },
|
||||
})
|
||||
if (imageToDestroy) {
|
||||
console.log(`image destroyed, publicId: ${imageToDestroy}, partId: ${id}`)
|
||||
console.log(`image destroyed, publicId: ${imageToDestroy}, partId: ${id}, replacing image is ${input.mainImage}`)
|
||||
// destroy after the db has been updated
|
||||
destroyImage({ publicId: imageToDestroy })
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ const SmallLoadingPing = (
|
||||
)
|
||||
|
||||
const BigLoadingPing = () => (
|
||||
<div className="inset-0 absolute flex items-center justify-center">
|
||||
<div className="inset-0 absolute flex items-center justify-center bg-ch-gray-800">
|
||||
<div className="h-16 w-16 bg-pink-600 rounded-full animate-ping"></div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -13,6 +13,7 @@ const OutBound = ({ className, children, to }) => {
|
||||
})
|
||||
return true
|
||||
}}
|
||||
rel="noreferrer"
|
||||
>
|
||||
{children}
|
||||
</a>
|
||||
|
||||
3164
app/yarn.lock
3164
app/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user