added claim availability check for channels via saga
This commit is contained in:
parent
9a7fdf4834
commit
52f2416d88
1 changed files with 8 additions and 1 deletions
|
@ -8,9 +8,16 @@ const { handleErrorResponse } = require('../../../utils/errorHandlers.js');
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
function addAtSymbolIfNecessary (name) {
|
||||||
|
if (name.substring(0,1) !== '@') {
|
||||||
|
return `@${name}`;
|
||||||
|
}
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
const channelAvailability = ({ ip, originalUrl, params: { name } }, res) => {
|
const channelAvailability = ({ ip, originalUrl, params: { name } }, res) => {
|
||||||
const gaStartTime = Date.now();
|
const gaStartTime = Date.now();
|
||||||
let name = `@${name}`;
|
name = addAtSymbolIfNecessary(name);
|
||||||
checkChannelAvailability(name)
|
checkChannelAvailability(name)
|
||||||
.then(isAvailable => {
|
.then(isAvailable => {
|
||||||
let responseObject = {
|
let responseObject = {
|
||||||
|
|
Loading…
Reference in a new issue