fix more logic for tests (cherry-picked from 83acb028c7)

This commit is contained in:
2025-05-31 16:20:41 -06:00
parent 92e4570672
commit be27ca1855
5 changed files with 19 additions and 19 deletions

View File

@@ -320,7 +320,7 @@ export default class GiftedDialog extends Vue {
this.fromProjectId,
);
if (!result.success || result.error) {
if (!result.success) {
const errorMessage = this.getGiveCreationErrorMessage(result);
logger.error("Error with give creation result:", result);
this.$notify(

View File

@@ -249,10 +249,7 @@ export default class OfferDialog extends Vue {
this.projectId,
);
if (
result.type === "error" ||
this.isOfferCreationError(result.response)
) {
if (!result.success) {
const errorMessage = this.getOfferCreationErrorMessage(result);
logger.error("Error with offer creation result:", result);
this.$notify(
@@ -296,15 +293,6 @@ export default class OfferDialog 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
isOfferCreationError(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