mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-07 08:40:16 +00:00
feat: prefix api folder with @
This commit is contained in:
parent
bade5b98e7
commit
4f41867e25
3 changed files with 5 additions and 5 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import { apiFetchDetails, apiFillDetails, apiLogin, apiLogout } from "../api/candidate";
|
import { apiFetchDetails, apiFillDetails, apiLogin, apiLogout } from "../@api/candidate";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
import type { ApiError } from "src/api";
|
import type { ApiError } from "src/@api";
|
||||||
|
|
||||||
export interface CandidateData {
|
export interface CandidateData {
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|
@ -30,7 +30,7 @@ export const candidateData = writable<CandidateData>();
|
||||||
export async function login(data: CandidateLogin) {
|
export async function login(data: CandidateLogin) {
|
||||||
// TODO: handle errors
|
// TODO: handle errors
|
||||||
try {
|
try {
|
||||||
let applicationId = await apiLogin(data); // TODO: set candidate data from response to store
|
const applicationId = await apiLogin(data); // TODO: set candidate data from response to store
|
||||||
console.log("login result: " + applicationId);
|
console.log("login result: " + applicationId);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("login failed");
|
console.error("login failed");
|
||||||
|
|
@ -50,7 +50,7 @@ export async function logout() {
|
||||||
|
|
||||||
export async function fillDetails(data: CandidateData) {
|
export async function fillDetails(data: CandidateData) {
|
||||||
try {
|
try {
|
||||||
let res = await apiFillDetails(data);
|
const res = await apiFillDetails(data);
|
||||||
candidateData.set(res);
|
candidateData.set(res);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
@ -60,7 +60,7 @@ export async function fillDetails(data: CandidateData) {
|
||||||
|
|
||||||
export async function fetchDetails() {
|
export async function fetchDetails() {
|
||||||
try {
|
try {
|
||||||
let res = await apiFetchDetails();
|
const res = await apiFetchDetails();
|
||||||
candidateData.set(res);
|
candidateData.set(res);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue