Update news view to check if the user has faved a news article or not &

the star button finally do something for the two weeks that is there.
Also done SOME user auth logic (aka revert bac kthe changes)
This commit is contained in:
yuanhau 2025-06-23 00:20:02 +08:00
parent 846c27293d
commit 5f37fb5049
2 changed files with 22 additions and 12 deletions

View file

@ -7,16 +7,6 @@ const error = ref(false);
const errorMsg = ref("");
const emit = defineEmits(["windowopener", "error", "loadValue"]);
/**
* return {
userAccount: fetchViaSQL[0].username,
firstName: fetchViaSQL[0].firstName,
requested_action: "CONTINUE",
current_spot: "KEEP_LOGIN",
email: fetchViaSQL[0].email,
avatarURL: fetchViaSQL[0].avatarurl,
};
*/
try {
// await :(
const { data, error: sendError } = await useFetch(
@ -25,7 +15,7 @@ try {
if (sendError.value) {
error.value = true;
}
if (data.requested_action === "KEEP_LOGIN") {
if (data.requested_action === "CONTINUE") {
if (data.userAccount && data.userAccount.length !== 0) {
allowed.value = true;
} else {