Skip to content

Commit

Permalink
✔ Fix Berkas Publik ~
Browse files Browse the repository at this point in the history
  • Loading branch information
bifeldy committed Aug 13, 2023
1 parent ba91ce7 commit 96095f9
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/fansubid/browser/ngsw.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"configVersion": 1,
"timestamp": 1691917704687,
"timestamp": 1691934840526,
"index": "/index.html",
"assetGroups": [
{
Expand Down
2 changes: 1 addition & 1 deletion dist/fansubid/server/main.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/api/controllers/anime-/anime-berkas.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ export class AnimeBerkasController {
const animeId = req.query['id'] ? (req.query['id'] as string).split(',').map(Number) : req.body.id;
if (Array.isArray(animeId) && animeId.length > 0) {
const sqlWhere = [
{
private: false,
name: ILike(`%${req.query['q'] ? req.query['q'] : ''}%`),
anime_: {
id: In(animeId)
},
user_: {
private: true
}
},
{
...((user?.verified) ? {
// Verified User Can See Private Berkas From Public Profile
Expand Down
8 changes: 8 additions & 0 deletions src/api/controllers/berkas.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ export class BerkasController {
const queryPage = parseInt(req.query['page'] as string);
const queryRow = parseInt(req.query['row'] as string);
const sqlWhere: any = [
{
private: false,
name: ILike(`%${req.query['q'] ? req.query['q'] : ''}%`),
r18: false,
user_: {
private: true
}
},
{
...((user?.verified) ? {
// Verified User Can See Private Berkas From Public Profile
Expand Down
10 changes: 10 additions & 0 deletions src/api/controllers/dorama-/dorama-berkas.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ export class DoramaBerkasController {
const doramaId = req.query['id'] ? (req.query['id'] as string).split(',') : req.body.id;
if (Array.isArray(doramaId) && doramaId.length > 0) {
const sqlWhere = [
{
private: false,
name: ILike(`%${req.query['q'] ? req.query['q'] : ''}%`),
dorama_: {
id: In(doramaId)
},
user_: {
private: true
}
},
{
...((user?.verified) ? {
// Verified User Can See Private Berkas From Public Profile
Expand Down
7 changes: 7 additions & 0 deletions src/api/controllers/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,13 @@ export class UserController {
const user: UserModel = res.locals['user'];
const [files, count] = await this.berkasRepo.findAndCount({
where: [
{
private: false,
name: ILike(`%${req.query['q'] ? req.query['q'] : ''}%`),
user_: {
username: ILike(req.params['username'])
}
},
{
name: ILike(`%${req.query['q'] ? req.query['q'] : ''}%`),
user_: {
Expand Down

0 comments on commit 96095f9

Please sign in to comment.