How to reactivate deleted item


I am working on a web app and I need to implement reactivation of deleted items.
I have a method that checks if the item exists already:

        item: string
    ): Observable<any> {
        if (item) {
            return this.http.get<any>(
                this.existenceUrl + item

and its interface looks like this

export interface ItemExistence {
    short: string;
    exists: boolean;
    isActive: boolean;
    isDeleted: boolean;
    deletedItemsId: number;

When this method says that item isDeleted: true then I need to call reactivateItem().

My issue is that I only have

        costObject: IItem
    ): Observable<any> {
        return this.http.get(this.url, costObject)

Please help.
So far I have this:

const input = this.form.get('short').value;

                .subscribe((existence: any) => {
                    this.itemsExistence =;
                    if (this.itemsExistence.isDeleted) {

reactivateItem(): void {
                - here I should implement reactivation of item with create method but I don't know how
            .subscribe(data => console.log(data);

Source: Angular Questions

Categorized as angular, canactivate, service, typescript Tagged , , ,


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us