a little bit of this a little bit of that
This commit is contained in:
@@ -15,6 +15,7 @@ import { AlbumModule } from './album/album.module';
|
|||||||
import { SearchModule } from './search/search.module';
|
import { SearchModule } from './search/search.module';
|
||||||
import { HistoryModule } from './history/history.module';
|
import { HistoryModule } from './history/history.module';
|
||||||
import { MailerModule } from '@nestjs-modules/mailer';
|
import { MailerModule } from '@nestjs-modules/mailer';
|
||||||
|
import { ScoresModule } from './scores/scores.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -29,6 +30,7 @@ import { MailerModule } from '@nestjs-modules/mailer';
|
|||||||
SearchModule,
|
SearchModule,
|
||||||
SettingsModule,
|
SettingsModule,
|
||||||
HistoryModule,
|
HistoryModule,
|
||||||
|
ScoresModule,
|
||||||
MailerModule.forRoot({
|
MailerModule.forRoot({
|
||||||
transport: process.env.SMTP_TRANSPORT,
|
transport: process.env.SMTP_TRANSPORT,
|
||||||
defaults: {
|
defaults: {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export class ScoresController {
|
|||||||
|
|
||||||
|
|
||||||
@ApiOkResponse({ description: 'Successfully sent the Top 20 players'})
|
@ApiOkResponse({ description: 'Successfully sent the Top 20 players'})
|
||||||
@Get('scores/top/20')
|
@Get('top/20')
|
||||||
getTopTwenty(): Promise<User[]> {
|
getTopTwenty(): Promise<User[]> {
|
||||||
return this.scoresService.topTwenty();
|
return this.scoresService.topTwenty();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export class ScoresService {
|
|||||||
async topTwenty(): Promise<User[]> {
|
async topTwenty(): Promise<User[]> {
|
||||||
return this.prisma.user.findMany({
|
return this.prisma.user.findMany({
|
||||||
orderBy: {
|
orderBy: {
|
||||||
partyPlayed: 'desc',
|
totalScore: 'desc',
|
||||||
},
|
},
|
||||||
take: 20,
|
take: 20,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import ButtonBase from "../UI/ButtonBase";
|
|||||||
import Artist from "../../models/Artist";
|
import Artist from "../../models/Artist";
|
||||||
import Song from "../../models/Song";
|
import Song from "../../models/Song";
|
||||||
import { AddSquare } from 'iconsax-react-native';
|
import { AddSquare } from 'iconsax-react-native';
|
||||||
|
import { useQuery } from "../../Queries";
|
||||||
|
import API from "../../API";
|
||||||
|
|
||||||
const artistsDummy = [
|
const artistsDummy = [
|
||||||
{
|
{
|
||||||
@@ -44,8 +46,12 @@ const genreDummy = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
type SearchBarComponentProps = {
|
||||||
|
query: string;
|
||||||
|
};
|
||||||
|
|
||||||
const SearchBarComponent = () => {
|
|
||||||
|
const SearchBarComponent = (props: SearchBarComponentProps) => {
|
||||||
const [isTriggered, setIsTriggered] = React.useState(false);
|
const [isTriggered, setIsTriggered] = React.useState(false);
|
||||||
const [genre, setGenre] = React.useState('')
|
const [genre, setGenre] = React.useState('')
|
||||||
const [query, setQuery] = React.useState('')
|
const [query, setQuery] = React.useState('')
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ interface User extends Model {
|
|||||||
interface UserData {
|
interface UserData {
|
||||||
gamesPlayed: number;
|
gamesPlayed: number;
|
||||||
xp: number;
|
xp: number;
|
||||||
|
totalScore: number;
|
||||||
avatar: string;
|
avatar: string;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import SearchBarComponent from "../../components/V2/SearchBar";
|
||||||
|
|
||||||
|
// search with all parameters from search bar function
|
||||||
|
|
||||||
|
// return to search bar auto completion thing
|
||||||
|
|
||||||
|
const SearchView = () => {
|
||||||
|
return (
|
||||||
|
<View style={{ display: 'flex', flexDirection: 'column', padding: 3 }} >
|
||||||
|
<SearchBarComponent query={"undefined"} />
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SearchView;
|
||||||
Reference in New Issue
Block a user