|
@@ -42,7 +42,8 @@ export const createShortLink = async (data: CreateLink, user: UserJoined) => {
|
|
|
...link,
|
|
...link,
|
|
|
password: !!data.password,
|
|
password: !!data.password,
|
|
|
reuse: !!data.reuse,
|
|
reuse: !!data.reuse,
|
|
|
- shortLink: generateShortLink(data.address, domain)
|
|
|
|
|
|
|
+ shortLink: generateShortLink(data.address, domain),
|
|
|
|
|
+ shortUrl: generateShortLink(data.address, domain)
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -207,11 +208,14 @@ export const getLinks = async (
|
|
|
"domains.id"
|
|
"domains.id"
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
const links = matchedLinks.map(link => ({
|
|
const links = matchedLinks.map(link => ({
|
|
|
...link,
|
|
...link,
|
|
|
id: link.address,
|
|
id: link.address,
|
|
|
password: !!link.password,
|
|
password: !!link.password,
|
|
|
- shortLink: generateShortLink(link.address, link.domain)
|
|
|
|
|
|
|
+ shortLink: generateShortLink(link.address, link.domain),
|
|
|
|
|
+ shortUrl: generateShortLink(link.address, link.domain)
|
|
|
}));
|
|
}));
|
|
|
|
|
|
|
|
return links;
|
|
return links;
|
|
@@ -299,6 +303,7 @@ interface IGetStatsResponse {
|
|
|
lastMonth: StatsResult;
|
|
lastMonth: StatsResult;
|
|
|
lastWeek: StatsResult;
|
|
lastWeek: StatsResult;
|
|
|
shortLink: string;
|
|
shortLink: string;
|
|
|
|
|
+ shortUrl: string;
|
|
|
target: string;
|
|
target: string;
|
|
|
total: number;
|
|
total: number;
|
|
|
updatedAt: string;
|
|
updatedAt: string;
|
|
@@ -448,6 +453,7 @@ export const getStats = async (link: Link, domain: Domain) => {
|
|
|
views: stats.lastWeek.views
|
|
views: stats.lastWeek.views
|
|
|
},
|
|
},
|
|
|
shortLink: generateShortLink(link.address, domain.address),
|
|
shortLink: generateShortLink(link.address, domain.address),
|
|
|
|
|
+ shortUrl: generateShortLink(link.address, domain.address),
|
|
|
target: link.target,
|
|
target: link.target,
|
|
|
total: link.visit_count,
|
|
total: link.visit_count,
|
|
|
updatedAt: new Date().toISOString()
|
|
updatedAt: new Date().toISOString()
|