feat(domaincheck): support all TLDs with suggestion alternatives
- Accept full domains (e.g. "example.xyz") not just labels - Check the entered TLD as primary result - Show .de, .com, .net, .org as alternative suggestions below - Primary result highlighted with accent border - Input without TLD still works (shows all 4 suggestions) - Updated i18n placeholders and added "suggestions" label Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,32 +3,14 @@ import { UseModule } from '../module-registry/module.guard';
|
||||
import { CheckDomainDto } from './dto/check-domain.dto';
|
||||
import { DomaincheckService } from './domaincheck.service';
|
||||
|
||||
/**
|
||||
* Controller for the Domaincheck module.
|
||||
*
|
||||
* POST /modules/domaincheck/check — accepts a domain label, checks TLD
|
||||
* variants via DNS, and returns availability status for each.
|
||||
*
|
||||
* Protected by @UseModule('domaincheck') which ensures the requesting
|
||||
* tenant has the domaincheck module activated (per T-03-08).
|
||||
*/
|
||||
@Controller('modules/domaincheck')
|
||||
@UseModule('domaincheck')
|
||||
export class DomaincheckController {
|
||||
constructor(private readonly domaincheckService: DomaincheckService) {}
|
||||
|
||||
/**
|
||||
* Check domain availability across TLD variants.
|
||||
*
|
||||
* @param dto - Contains domain label and optional TLD list
|
||||
* @returns Domain and results array with tld, fqdn, and status
|
||||
*/
|
||||
@Post('check')
|
||||
async checkDomain(@Body() dto: CheckDomainDto) {
|
||||
const results = await this.domaincheckService.checkDomain(
|
||||
dto.domain,
|
||||
dto.tlds,
|
||||
);
|
||||
const results = await this.domaincheckService.checkDomain(dto.domain);
|
||||
|
||||
return {
|
||||
domain: dto.domain,
|
||||
|
||||
Reference in New Issue
Block a user