Skip to content

Commit

Permalink
sorting by mimetype implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhikachhawa24 committed Jun 18, 2024
1 parent 89b62c4 commit 0c1f0cc
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 30 deletions.
11 changes: 8 additions & 3 deletions src/app/services/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,20 @@ export class ConfigService {
}

async getAllContent(req: any, lang: any): Promise<any> {
let request = {
language: lang
let requestBody = {
language: lang,
request: {
orderBy: {
"mimetype": "video/x-youtube"
}
}
}
const apiRequest = new ApiRequest.Builder()
.withHost(config.api.BASE_URL)
.withPath(config.api.PAGE_SEARCH_API)
.withType(ApiHttpRequestType.POST)
.withBearerToken(true)
.withBody(request)
.withBody(requestBody)
.withLanguge(lang)
.build()
return lastValueFrom(this.apiService.fetch(apiRequest).pipe(
Expand Down
49 changes: 28 additions & 21 deletions src/app/services/search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,29 @@ export class SearchService {
) { }

async postSearchContext(data: any, audio: boolean): Promise<any> {
let request = {};
let requestBody = {};
if (audio) {
request = {
"audio": data.text,
"language": data.currentLang
requestBody = {
audio: data.text,
language: data.currentLang,
request: {
orderBy: {
"mimetype": "video/x-youtube"
}
}
}
} else {
request = {
"name": data.text,
"language": data.currentLang
requestBody = {
name: data.text,
language: data.currentLang,
request: {
orderBy: {
"mimetype": "video/x-youtube"
}
}
}
}
let body = JSON.stringify(request)
let body = JSON.stringify(requestBody)
console.log("body ", body);
const apiRequest = new ApiRequest.Builder()
.withHost(config.api.BASE_URL)
Expand All @@ -48,24 +58,21 @@ export class SearchService {
}

postContentSearch(data: any, lang: any): Promise<any> {
let req : any= {};
if(data['name'])
{
req['name'] = data?.name;
}

if(data['category'])
{
req['category'] = data?.category;
let requestBody = {
name: data?.name,
category: data?.category,
language: lang,
request: {
orderBy: {
"mimetype": "video/x-youtube"
},
}
}

req['language'] = lang;

const apiRequest = new ApiRequest.Builder()
.withHost(config.api.BASE_URL)
.withPath(config.api.CONTENT_SEARCH_API)
.withType(ApiHttpRequestType.POST)
.withBody(req)
.withBody(requestBody)
.withBearerToken(true)
.withLanguge(lang)
.build()
Expand Down
2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<body>
<app-root></app-root>
<noscript>Please enable JavaScript to continue using this application.</noscript>
<script src="runtime.9292150e0d83ae8f.js" type="module"></script><script src="polyfills.8aa0ed51fddab033.js" type="module"></script><script src="scripts.f969b614b9decf68.js" defer></script><script src="main.e577895ba48629a2.js" type="module"></script></body>
<script src="runtime.9292150e0d83ae8f.js" type="module"></script><script src="polyfills.8aa0ed51fddab033.js" type="module"></script><script src="scripts.f969b614b9decf68.js" defer></script><script src="main.900d177c1519705a.js" type="module"></script></body>

</html>
1 change: 1 addition & 0 deletions www/main.900d177c1519705a.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion www/main.e577895ba48629a2.js

This file was deleted.

8 changes: 4 additions & 4 deletions www/ngsw.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"configVersion": 1,
"timestamp": 1718685428339,
"timestamp": 1718697582044,
"index": "/index.html",
"assetGroups": [
{
Expand Down Expand Up @@ -101,7 +101,7 @@
"/9977.dfb6af23e31fcb21.js",
"/common.d5afa357a12054a6.js",
"/index.html",
"/main.e577895ba48629a2.js",
"/main.900d177c1519705a.js",
"/manifest.webmanifest",
"/polyfills-core-js.c76198334f717402.js",
"/polyfills-dom.bf542500b6fca113.js",
Expand Down Expand Up @@ -845,8 +845,8 @@
"/assets/timer.svg": "57b27e5d93af2aabd1077ecd4c70bcab678f4472",
"/assets/user.svg": "2dc572771661b2ccd3ea4ae06bf768778144cbec",
"/common.d5afa357a12054a6.js": "4def9eb63d9c0e8e525a0fc947d54f807f1e5f88",
"/index.html": "7b82cc5bb10ca91c15732733fd23a84e96ae3206",
"/main.e577895ba48629a2.js": "8105ec380dcea0b4f7780bb946cfeba1c6519aaf",
"/index.html": "ea4be219e781c016067c2a50376460df4e1ae3ce",
"/main.900d177c1519705a.js": "cbca8fc9da024ccac54653b5119cf145fc94ee00",
"/manifest.webmanifest": "5a927f2c991153c4e1fb8dd9fd7845bbe00ba537",
"/polyfills-core-js.c76198334f717402.js": "d6e270a2944b6a95a9b97dafd25599ba825e8d7f",
"/polyfills-dom.bf542500b6fca113.js": "3fa333db66c8050f12e99d977f5098a6de8dd593",
Expand Down

0 comments on commit 0c1f0cc

Please sign in to comment.