Skip to content

Commit

Permalink
fix: unify forward slash
Browse files Browse the repository at this point in the history
  • Loading branch information
mwargan committed Apr 24, 2024
1 parent 186cffe commit c65e766
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
26 changes: 13 additions & 13 deletions src/stores/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const useUserStore = defineStore("user", () => {

// Check if the email is already in use by calling POST "email-exists/" + email with axios. If it returns 404, the email is not in use.
try {
const response = await axios.post("email-exists/" + email);
const response = await axios.post("/email-exists/" + email);
return response.status === 200;
} catch (error: any) {
if (error.response.status === 404) {
Expand Down Expand Up @@ -102,7 +102,7 @@ export const useUserStore = defineStore("user", () => {

// Check if the email is already in use
try {
await axios.post("login", {
await axios.post("/login", {
email: email,
password: password,
});
Expand Down Expand Up @@ -144,7 +144,7 @@ export const useUserStore = defineStore("user", () => {

try {
// Check if the email is already in use
await axios.post("register", {
await axios.post("/register", {
email: email,
password: password,
password_confirmation: password,
Expand Down Expand Up @@ -179,7 +179,7 @@ export const useUserStore = defineStore("user", () => {

// Submit a reset password
try {
await axios.post("user/otp", {
await axios.post("/user/otp", {
[method]: notifiable,
});
$bus.$emit(eventTypes.sent_otp);
Expand All @@ -205,7 +205,7 @@ export const useUserStore = defineStore("user", () => {

// Submit a reset password
try {
await axios.post("user/otp/confirm", {
await axios.post("/user/otp/confirm", {
otp: otp,
});
$bus.$emit(eventTypes.confirmed_otp);
Expand All @@ -230,7 +230,7 @@ export const useUserStore = defineStore("user", () => {
}
isLoading.value = true;
try {
await axios.post("email/verification-notification", {
await axios.post("/email/verification-notification", {
email: user.value.email,
});
return true;
Expand All @@ -256,7 +256,7 @@ export const useUserStore = defineStore("user", () => {

// Submit a reset password
try {
await axios.post("forgot-password", {
await axios.post("/forgot-password", {
email: email,
});
$bus.$emit(eventTypes.sent_reset_password_email);
Expand Down Expand Up @@ -297,7 +297,7 @@ export const useUserStore = defineStore("user", () => {

// Submit a reset password
try {
await axios.post("reset-password", {
await axios.post("/reset-password", {
email: email,
token: token,
password: password,
Expand Down Expand Up @@ -327,7 +327,7 @@ export const useUserStore = defineStore("user", () => {

// Submit a reset password
try {
await axios.post("user/confirm-password", {
await axios.post("/user/confirm-password", {
password: password,
});
$bus.$emit(eventTypes.confirmed_password);
Expand All @@ -347,7 +347,7 @@ export const useUserStore = defineStore("user", () => {
async function shouldConfirmPassword() {
isLoading.value = true;
try {
const response = await axios.get("user/confirmed-password-status");
const response = await axios.get("/user/confirmed-password-status");
return !response.data.confirmed;
} catch (error: any) {
return error.response;
Expand All @@ -361,7 +361,7 @@ export const useUserStore = defineStore("user", () => {
*
*/
async function getCsrfToken() {
await axios.get("sanctum/csrf-cookie");
await axios.get("/sanctum/csrf-cookie");
}

/**
Expand All @@ -370,7 +370,7 @@ export const useUserStore = defineStore("user", () => {
*/
async function logout() {
isLoading.value = true;
await axios.post("logout");
await axios.post("/logout");
isAuthenticated.value = false;
user.value = null;
isLoading.value = false;
Expand All @@ -387,7 +387,7 @@ export const useUserStore = defineStore("user", () => {
async function update(name: string, email: string, phone?: string | null) {
isLoading.value = true;
try {
await axios.put("user/profile-information", {
await axios.put("/user/profile-information", {
name: name ?? user.value?.name,
email: email ?? user.value?.email,
phone_number: phone ?? user.value?.phone_number,
Expand Down
6 changes: 3 additions & 3 deletions src/useRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const getAllRules = async (redirectId?: string) => {
isLoading.value = true;

const endpoint = redirectId
? `api/v1/rules?redirectId=${redirectId}`
: "api/v1/rules";
? `/api/v1/rules?redirectId=${redirectId}`
: "/api/v1/rules";

// We need to unset the default accept-language header just for this request - so that it uses the default language provided by the browser and our language rule can be checked correctly
const response = await axios.get(endpoint, {
Expand Down Expand Up @@ -57,7 +57,7 @@ const testRule = async (
// We need to unset the default accept-language header just for this request - so that it uses the default language provided by the browser and our language rule can be checked correctly. Because its a post request to `api/v1/rules/${ruleName}/test?operator=${operator}&value=${value}`, we need to set the headers in the data object
const response = await axios
.post(
`api/v1/rules/${ruleName}/test?operator=${operator}&value=${value}`,
`/api/v1/rules/${ruleName}/test?operator=${operator}&value=${value}`,
{},
{
transformRequest: [
Expand Down
2 changes: 1 addition & 1 deletion src/views/AnalyticsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const getData = async (startDate?: string, endDate?: string) => {
"languages",
];
const response = await axios.get("api/v1/redirects/analytics", {
const response = await axios.get("/api/v1/redirects/analytics", {
params: {
// Needs to be passed as an array
withCount,
Expand Down
2 changes: 1 addition & 1 deletion src/views/DashboardView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const itemData = computed(() => ({
href: "/settings",
target: "",
// If the email ends with @novu.link, we consider it incomplete
completed: !userStore.user?.email.endsWith("@novu.link"),
completed: !userStore.user?.email?.endsWith("@novu.link"),
},
{
text: t("Confirm your email"),
Expand Down

0 comments on commit c65e766

Please sign in to comment.