Skip to content

Commit

Permalink
👔 Remove url iscn mapping check
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Feb 21, 2025
1 parent b14dbfa commit e06f0f6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
15 changes: 0 additions & 15 deletions src/mixins/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
apiPostLikeButton,
apiPostSuperLike,
apiGetUserMinById,
apiGetURLToISCNMapping,
apiGetLikeButtonTotalCount,
apiGetLikeButtonMyStatus,
apiGetLikeButtonSelfCount,
Expand Down Expand Up @@ -134,20 +133,6 @@ export default {
if (checkIsValidISCNId(id)) {
iscnId = id;
} else if (id !== 'iscn') {
const mappingDataRes = await apiGetURLToISCNMapping(id, referrer).catch((err) => {
if (!(err.response && err.response.status === 404)) {
console.error(JSON.stringify({ // eslint-disable-line no-console
message: err,
stack: err.stack,
}));
}
});
if (mappingDataRes && mappingDataRes.data) {
// TODO: use iscnId instead of composing from prefix and id
const { iscnPrefix, iscnVersion } = mappingDataRes.data;
iscnId = `${iscnPrefix}/${iscnVersion}`;
}

if (!iscnId) {
const { data } = await apiGetUserMinById(id).catch((err) => {
if (!(err.response && err.response.status === 404)) {
Expand Down
2 changes: 0 additions & 2 deletions src/util/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ function getLikeCoinButtonHeaders({

export const apiGetUserMinById = id => axios.get(`${LIKECOIN_API}/users/id/${id}/min`);

export const apiGetURLToISCNMapping = (likerId, referrer) => axios.get(`${LIKECOIN_API}/like/iscn/mapping?liker_id=${encodeURIComponent(likerId)}&url=${encodeURIComponent(referrer)}`);

export const apiGetLikeButtonMyStatus = (id, data) => {
const {
referrer = '',
Expand Down

0 comments on commit e06f0f6

Please sign in to comment.