|
|
@ -825,10 +825,7 @@ export default class GiftedDetails extends Vue { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
if ( |
|
|
|
result.type === "error" || |
|
|
|
this.isGiveCreationError(result.response) |
|
|
|
) { |
|
|
|
if (!result.success) { |
|
|
|
const errorMessage = this.getGiveCreationErrorMessage(result); |
|
|
|
logger.error("Error with give creation result:", result); |
|
|
|
this.$notify( |
|
|
@ -902,15 +899,6 @@ export default class GiftedDetails extends Vue { |
|
|
|
|
|
|
|
// Helper functions for readability |
|
|
|
|
|
|
|
/** |
|
|
|
* @param result response "data" from the server |
|
|
|
* @returns true if the result indicates an error |
|
|
|
*/ |
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
|
|
|
isGiveCreationError(result: any) { |
|
|
|
return result.status !== 201 || result.data?.error; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param result direct response eg. ErrorResult or SuccessResult (potentially with embedded "data") |
|
|
|
* @returns best guess at an error message |
|
|
|