35 lines
851 B
TypeScript
35 lines
851 B
TypeScript
import type { Want, User } from '@prisma/client';
|
|
|
|
export function logAxiosError(e) {
|
|
console.warn({
|
|
status: e.response.status,
|
|
statusText: e.response.statusText,
|
|
url: e.config.url,
|
|
data: e.response.data,
|
|
rateLimiting: {
|
|
limit: e.response.headers['x-discogs-ratelimit'],
|
|
remaining: e.response.headers['x-discogs-ratelimit-remaining'],
|
|
used: e.response.headers['x-discogs-ratelimit-used'],
|
|
},
|
|
});
|
|
}
|
|
|
|
export function wantDetails(want: Want) {
|
|
const data = want.data as any;
|
|
|
|
if (!data) console.warn(want);
|
|
|
|
return {
|
|
title: data.title,
|
|
release: data.id,
|
|
artist: data.artists_sort,
|
|
id: want.id
|
|
}
|
|
}
|
|
|
|
export function isAdmin(user: User) {
|
|
return user.email === 'ntr@mnml.gg';
|
|
}
|
|
|
|
export function offerDetails() {}
|