feat: enhance dynamic forms and popups for About, Contact, and Resume sections; add project detail popup
This commit is contained in:
@@ -13,15 +13,11 @@ export class AdminStateService {
|
||||
private store = inject(AdminStore);
|
||||
private api = inject(AdminService);
|
||||
|
||||
setCandidateId(id: number) {
|
||||
this.store.update({ candidateId: id });
|
||||
}
|
||||
|
||||
// ── About ──────────────────────────────────────────────
|
||||
|
||||
loadAbout(candidateId: number) {
|
||||
loadAbout() {
|
||||
this.store.setSectionLoading('about', true);
|
||||
return this.api.getHobbies(candidateId).pipe(
|
||||
return this.api.getHobbies().pipe(
|
||||
tap({
|
||||
next: (about: IAbout) => {
|
||||
this.store.update({ about });
|
||||
@@ -40,9 +36,9 @@ export class AdminStateService {
|
||||
this.store.update({ about });
|
||||
}
|
||||
|
||||
upsertHobbies(resumeId: number, hobbies: IHobby[]) {
|
||||
upsertHobbies(hobbies: IHobby[]) {
|
||||
this.store.setSectionLoading('about', true);
|
||||
return this.api.upsertHobbies(resumeId, hobbies).pipe(
|
||||
return this.api.upsertHobbies(hobbies).pipe(
|
||||
tap({
|
||||
next: (updatedHobbies: IHobby[]) => {
|
||||
this.store.update(state => ({
|
||||
@@ -61,9 +57,9 @@ export class AdminStateService {
|
||||
|
||||
// ── Contact ────────────────────────────────────────────
|
||||
|
||||
loadContact(candidateId: number) {
|
||||
loadContact() {
|
||||
this.store.setSectionLoading('contact', true);
|
||||
return this.api.getCandidateWithSocialLinks(candidateId).pipe(
|
||||
return this.api.getCandidateWithSocialLinks().pipe(
|
||||
tap({
|
||||
next: (contact: IContactModel) => {
|
||||
this.store.update({ contact });
|
||||
@@ -84,9 +80,9 @@ export class AdminStateService {
|
||||
|
||||
// ── Projects ───────────────────────────────────────────
|
||||
|
||||
loadProjects(candidateId: number) {
|
||||
loadProjects() {
|
||||
this.store.setSectionLoading('projects', true);
|
||||
return this.api.getProjects(candidateId).pipe(
|
||||
return this.api.getProjects().pipe(
|
||||
tap({
|
||||
next: (projects: IProjects) => {
|
||||
this.store.update({ projects });
|
||||
@@ -107,9 +103,9 @@ export class AdminStateService {
|
||||
|
||||
// ── Resume ─────────────────────────────────────────────
|
||||
|
||||
loadResume(candidateId: number) {
|
||||
loadResume() {
|
||||
this.store.setSectionLoading('resume', true);
|
||||
return this.api.getResume(candidateId).pipe(
|
||||
return this.api.getResume().pipe(
|
||||
tap({
|
||||
next: (resume: IResume) => {
|
||||
this.store.update({ resume });
|
||||
|
||||
Reference in New Issue
Block a user