Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TAS-1217] 🚸 Add default value to stakeholders #440

Merged
merged 4 commits into from
Feb 16, 2024

Conversation

AuroraHuang22
Copy link
Collaborator

截圖 2024-02-15 下午5 11 51

Copy link

AuroraHuang22 added a commit that referenced this pull request Feb 15, 2024
Comment on lines 1135 to 1137
const { data } = await this.$axios.get(
getUserInfoMinByAddress(this.address),
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this throw 404 error, skipping the whole iscnOwner block if the address does not have likeId?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@williamchong williamchong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we can consider using catchAxiosError, but I think even non-404 error should be caught in this case

Comment on lines 1143 to 1162
try {
const { data } = await this.$axios.get(getUserInfoMinByAddress(address))
return {
name: data?.displayName || address,
wallet: [{ content: address, id: 1, type: 'like', isOpenOptions: false }],
url: [],
likerId: data?.user || '',
authorDescription: data?.description || 'Publisher',
}
} catch (error) {
// eslint-disable-next-line no-console
console.error(error)
return {
name: address,
wallet: [{ content: address, id: 1, type: 'like', isOpenOptions: false }],
url: [],
likerId: '',
authorDescription: 'Publisher',
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
try {
const { data } = await this.$axios.get(getUserInfoMinByAddress(address))
return {
name: data?.displayName || address,
wallet: [{ content: address, id: 1, type: 'like', isOpenOptions: false }],
url: [],
likerId: data?.user || '',
authorDescription: data?.description || 'Publisher',
}
} catch (error) {
// eslint-disable-next-line no-console
console.error(error)
return {
name: address,
wallet: [{ content: address, id: 1, type: 'like', isOpenOptions: false }],
url: [],
likerId: '',
authorDescription: 'Publisher',
}
}
let userData: any = null;
try {
({ data: userData } = await this.$axios.get(getUserInfoMinByAddress(address)))
} catch (error) {
// eslint-disable-next-line no-console
console.error(error)
}
return {
name: userData?.displayName || address,
wallet: [{ content: address, id: 1, type: 'like', isOpenOptions: false }],
url: [],
likerId: userData?.user || '',
authorDescription: userData?.description || 'Publisher',
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@williamchong williamchong merged commit ac2ba71 into likecoin:main Feb 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants