|
@ -223,17 +223,14 @@ import { |
|
|
didInfo, |
|
|
didInfo, |
|
|
GiveServerRecord, |
|
|
GiveServerRecord, |
|
|
} from "@/libs/endorserServer"; |
|
|
} from "@/libs/endorserServer"; |
|
|
import AlertMessage from "@/components/AlertMessage"; |
|
|
|
|
|
import QuickNav from "@/components/QuickNav"; |
|
|
import QuickNav from "@/components/QuickNav"; |
|
|
import EntityIcon from "@/components/EntityIcon"; |
|
|
import EntityIcon from "@/components/EntityIcon"; |
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
components: { GiftedDialog, AlertMessage, QuickNav, EntityIcon }, |
|
|
components: { GiftedDialog, QuickNav, EntityIcon }, |
|
|
}) |
|
|
}) |
|
|
export default class ProjectViewView extends Vue { |
|
|
export default class ProjectViewView extends Vue { |
|
|
activeDid = ""; |
|
|
activeDid = ""; |
|
|
alertMessage = ""; |
|
|
|
|
|
alertTitle = ""; |
|
|
|
|
|
allMyDids: Array<string> = []; |
|
|
allMyDids: Array<string> = []; |
|
|
allContacts: Array<Contact> = []; |
|
|
allContacts: Array<Contact> = []; |
|
|
apiServer = ""; |
|
|
apiServer = ""; |
|
@ -342,7 +339,7 @@ export default class ProjectViewView extends Vue { |
|
|
this.longitude = resp.data.claim?.location?.geo?.longitude || 0; |
|
|
this.longitude = resp.data.claim?.location?.geo?.longitude || 0; |
|
|
} else if (resp.status === 404) { |
|
|
} else if (resp.status === 404) { |
|
|
// actually, axios throws an error so we never get here |
|
|
// actually, axios throws an error so we never get here |
|
|
this.$notify( |
|
|
(this as any).$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
|
type: "danger", |
|
|
type: "danger", |
|
@ -355,7 +352,7 @@ export default class ProjectViewView extends Vue { |
|
|
} catch (error: unknown) { |
|
|
} catch (error: unknown) { |
|
|
const serverError = error as AxiosError; |
|
|
const serverError = error as AxiosError; |
|
|
if (serverError.response?.status === 404) { |
|
|
if (serverError.response?.status === 404) { |
|
|
this.$notify( |
|
|
(this as any).$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
|
type: "danger", |
|
|
type: "danger", |
|
@ -365,7 +362,7 @@ export default class ProjectViewView extends Vue { |
|
|
-1, |
|
|
-1, |
|
|
); |
|
|
); |
|
|
} else { |
|
|
} else { |
|
|
this.$notify( |
|
|
(this as any).$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
|
type: "danger", |
|
|
type: "danger", |
|
@ -387,7 +384,7 @@ export default class ProjectViewView extends Vue { |
|
|
if (resp.status === 200 && resp.data.data) { |
|
|
if (resp.status === 200 && resp.data.data) { |
|
|
this.givesToThis = resp.data.data; |
|
|
this.givesToThis = resp.data.data; |
|
|
} else { |
|
|
} else { |
|
|
this.$notify( |
|
|
(this as any).$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
|
type: "danger", |
|
|
type: "danger", |
|
@ -399,7 +396,7 @@ export default class ProjectViewView extends Vue { |
|
|
} |
|
|
} |
|
|
} catch (error: unknown) { |
|
|
} catch (error: unknown) { |
|
|
const serverError = error as AxiosError; |
|
|
const serverError = error as AxiosError; |
|
|
this.$notify( |
|
|
(this as any).$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
|
type: "danger", |
|
|
type: "danger", |
|
@ -423,7 +420,7 @@ export default class ProjectViewView extends Vue { |
|
|
if (resp.status === 200 && resp.data.data) { |
|
|
if (resp.status === 200 && resp.data.data) { |
|
|
this.givesByThis = resp.data.data; |
|
|
this.givesByThis = resp.data.data; |
|
|
} else { |
|
|
} else { |
|
|
this.$notify( |
|
|
(this as any).$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
|
type: "danger", |
|
|
type: "danger", |
|
@ -435,7 +432,7 @@ export default class ProjectViewView extends Vue { |
|
|
} |
|
|
} |
|
|
} catch (error: unknown) { |
|
|
} catch (error: unknown) { |
|
|
const serverError = error as AxiosError; |
|
|
const serverError = error as AxiosError; |
|
|
this.$notify( |
|
|
(this as any).$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
|
type: "danger", |
|
|
type: "danger", |
|
@ -486,9 +483,9 @@ export default class ProjectViewView extends Vue { |
|
|
* @param description may be an empty string |
|
|
* @param description may be an empty string |
|
|
* @param hours may be 0 |
|
|
* @param hours may be 0 |
|
|
*/ |
|
|
*/ |
|
|
async recordGive(giverDid, description, hours) { |
|
|
async recordGive(giverDid, description: string, hours: number) { |
|
|
if (!this.activeDid) { |
|
|
if (!this.activeDid) { |
|
|
this.$notify( |
|
|
(this as any).$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
|
type: "danger", |
|
|
type: "danger", |
|
@ -501,7 +498,7 @@ export default class ProjectViewView extends Vue { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!description && !hours) { |
|
|
if (!description && !hours) { |
|
|
this.$notify( |
|
|
(this as any).$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
|
type: "danger", |
|
|
type: "danger", |
|
@ -528,7 +525,7 @@ export default class ProjectViewView extends Vue { |
|
|
|
|
|
|
|
|
if (result.status !== 201 || result.data?.error) { |
|
|
if (result.status !== 201 || result.data?.error) { |
|
|
console.log("Error with give result:", result); |
|
|
console.log("Error with give result:", result); |
|
|
this.$notify( |
|
|
(this as any).$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
|
type: "danger", |
|
|
type: "danger", |
|
@ -540,7 +537,7 @@ export default class ProjectViewView extends Vue { |
|
|
-1, |
|
|
-1, |
|
|
); |
|
|
); |
|
|
} else { |
|
|
} else { |
|
|
this.$notify( |
|
|
(this as any).$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
|
type: "success", |
|
|
type: "success", |
|
@ -552,14 +549,14 @@ export default class ProjectViewView extends Vue { |
|
|
} |
|
|
} |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
console.log("Error with give caught:", e); |
|
|
console.log("Error with give caught:", e); |
|
|
this.$notify( |
|
|
(this as any).$notify( |
|
|
{ |
|
|
{ |
|
|
group: "alert", |
|
|
group: "alert", |
|
|
type: "danger", |
|
|
type: "danger", |
|
|
title: "Error", |
|
|
title: "Error", |
|
|
text: |
|
|
text: |
|
|
e.userMessage || |
|
|
e?.userMessage || |
|
|
e.response?.data?.error?.message || |
|
|
e?.response?.data?.error?.message || |
|
|
"There was an error recording the give.", |
|
|
"There was an error recording the give.", |
|
|
}, |
|
|
}, |
|
|
-1, |
|
|
-1, |
|
|