Delete user block landing.repo.unregister

We are still updating this page

Some data may be missing here — we will complete it shortly.

Scope: landing

Who can execute the method: any user

The method landing.repo.unregister deletes a block. It returns true upon deletion or false if the block has already been deleted or did not exist.

Parameters

Method

Description

code
unknown

Unique code of the block to be deleted.

Examples

try
        {
        	const response = await $b24.callMethod(
        		'landing.repo.unregister',
        		{code: 'myblockx'}
        	);
        	
        	const result = response.getData().result;
        	if(result.error())
        	{
        		console.error(result.error());
        	}
        	else
        	{
        		console.info(result);
        	}
        }
        catch(error)
        {
        	console.error('Error:', error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'landing.repo.unregister',
                    [
                        'code' => 'myblockx',
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            if ($result->error()) {
                error_log($result->error());
            } else {
                echo 'Success: ' . print_r($result->data(), true);
            }
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error unregistering landing repo: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'landing.repo.unregister',
            {code: 'myblockx'},
            function(result)
            {
                if(result.error())
                    console.error(result.error());
                else
                    console.info(result.data());
            }
        );
        

How to Use Examples in Documentation